diff options
| author | Dobes Vandermeer <dvandermeer@roovy.com> | 2014-04-24 15:20:57 -0700 |
|---|---|---|
| committer | Dobes Vandermeer <dvandermeer@roovy.com> | 2014-04-24 15:20:57 -0700 |
| commit | 338ca8e48827840ad5db4ee4f677e4d3fcd315c9 (patch) | |
| tree | 483e7092969c364fff255b6ed24d1845c2e45c5f /lib/sqlalchemy/dialects/sqlite/base.py | |
| parent | 5016b581b6a0099b5d4babf885ae1f2c05a9589f (diff) | |
| download | sqlalchemy-338ca8e48827840ad5db4ee4f677e4d3fcd315c9.tar.gz | |
Proof-of-concept implementation of supporting bindparam for offset and limit on a query.
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/sqlite/base.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 90df9c192..1ae565232 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -185,6 +185,7 @@ from ... import types as sqltypes, schema as sa_schema from ... import util from ...engine import default, reflection from ...sql import compiler +from sqlalchemy.sql.elements import _literal_as_binds from ...types import (BLOB, BOOLEAN, CHAR, DATE, DECIMAL, FLOAT, INTEGER, REAL, NUMERIC, SMALLINT, TEXT, TIMESTAMP, VARCHAR) @@ -520,11 +521,11 @@ class SQLiteCompiler(compiler.SQLCompiler): def limit_clause(self, select): text = "" if select._limit is not None: - text += "\n LIMIT " + self.process(sql.literal(select._limit)) + text += "\n LIMIT " + self.process(_literal_as_binds(select._limit)) if select._offset is not None: if select._limit is None: text += "\n LIMIT " + self.process(sql.literal(-1)) - text += " OFFSET " + self.process(sql.literal(select._offset)) + text += " OFFSET " + self.process(_literal_as_binds(select._offset)) else: text += " OFFSET " + self.process(sql.literal(0)) return text |
