[Modeling-cvs] ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer MySQLSQLExpression.py,1.4
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2003-03-17 12:47:38
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer In directory sc8-pr-cvs1:/tmp/cvs-serv14304/DatabaseAdaptors/MySQLAdaptorLayer Modified Files: Tag: brch-0_9pre5-SQL_SortOrdering_and_LIMIT MySQLSQLExpression.py Log Message: MySQL/PostgresqlAdaptorLayers: SQLExpression: added support for fetch slices, implemented limitString() Index: MySQLSQLExpression.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer/MySQLSQLExpression.py,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** MySQLSQLExpression.py 8 Mar 2003 16:21:01 -0000 1.4 --- MySQLSQLExpression.py 17 Mar 2003 12:47:35 -0000 1.4.2.1 *************** *** 44,47 **** --- 44,64 ---- available SQL data types. """ + def limitString(self): + """ + Returns LIMIT [<offset>,]<limit> + + 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 %(offset)s,%(limit)s'%slice + return '' + def valueTypeForExternalTypeMapping(self): """ |