Update of /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer
In directory sc8-pr-cvs1:/tmp/cvs-serv14304/DatabaseAdaptors/PostgresqlAdaptorLayer
Modified Files:
Tag: brch-0_9pre5-SQL_SortOrdering_and_LIMIT
PostgresqlSQLExpression.py
Log Message:
MySQL/PostgresqlAdaptorLayers: SQLExpression: added support for fetch
slices, implemented limitString()
Index: PostgresqlSQLExpression.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer/PostgresqlSQLExpression.py,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** PostgresqlSQLExpression.py 28 Jan 2003 18:15:34 -0000 1.1
--- PostgresqlSQLExpression.py 17 Mar 2003 12:47:34 -0000 1.1.2.1
***************
*** 43,46 ****
--- 43,63 ----
"""
+ def limitString(self):
+ """
+ Returns LIMIT <limit> [OFFSET <offset>]
+
+ where <limit> and <offset> are the values of the dictionary returned by
+ SQLExpression.fetchLimit()
+
+ The 'OFFSET' part of the string is not included if offset is zero.
+ """
+ slice=self.fetchSlice()
+ if tuple(slice.values())!=(0,0):
+ if not slice['offset']:
+ return 'LIMIT %(limit)s'%slice
+ else:
+ return 'LIMIT %(limit)s OFFSET %(offset)s'%slice
+ return ''
+
def valueTypeForExternalTypeMapping(self):
"""
|