summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/postgres.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-12-07 01:37:55 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-12-07 01:37:55 +0000
commit44abaa9e567e6c412a2ce499907c65d97aa865dc (patch)
tree220c93883b683dcbaf2791a4caf269320abca1d1 /lib/sqlalchemy/databases/postgres.py
parent478b0e15ed70ae109e76b696efe151b7acac036b (diff)
downloadsqlalchemy-44abaa9e567e6c412a2ce499907c65d97aa865dc.tar.gz
added rudimentary support for limit and offset (with the hack version in oracle)
fixed up order_by to support a list/scalar of columns or asc/desc fixed up query.py unit test
Diffstat (limited to 'lib/sqlalchemy/databases/postgres.py')
-rw-r--r--lib/sqlalchemy/databases/postgres.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 5a3d6388a..531e8af03 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -240,6 +240,16 @@ class PGCompiler(ansisql.ANSICompiler):
if c.sequence is not None and not c.sequence.optional:
self.bindparams[c.key] = None
return ansisql.ANSICompiler.visit_insert(self, insert)
+
+ def limit_clause(self, select):
+ text = ""
+ if select.limit is not None:
+ text += " \n LIMIT " + str(select.limit)
+ if select.offset is not None:
+ if select.limit is None:
+ text += " \n LIMIT ALL"
+ text += " OFFSET " + str(select.offset)
+ return text
class PGSchemaGenerator(ansisql.ANSISchemaGenerator):
def get_column_specification(self, column, override_pk=False, **kwargs):