summaryrefslogtreecommitdiff
path: root/django/core/db/backends/sqlite3.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-08-19 21:51:14 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-08-19 21:51:14 +0000
commite5e1ea602d9393a29400098dc40d0f9de846fdd1 (patch)
tree5faff0e0db0d2934df91ad90b36cab52b14ef974 /django/core/db/backends/sqlite3.py
parent9180112f021d0a2a16e29565ece4f137a1a99823 (diff)
Fixed #350 -- 'offset' DB API parameter now works in MySQL 3. Tests from [540] pass. Thanks, ronan@cremin.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/db/backends/sqlite3.py')
-rw-r--r--django/core/db/backends/sqlite3.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/core/db/backends/sqlite3.py b/django/core/db/backends/sqlite3.py
index 38ce767dfb..eef596eff0 100644
--- a/django/core/db/backends/sqlite3.py
+++ b/django/core/db/backends/sqlite3.py
@@ -97,6 +97,12 @@ def get_date_trunc_sql(lookup_type, field_name):
# sqlite doesn't support DATE_TRUNC, so we fake it as above.
return 'django_date_trunc("%s", %s)' % (lookup_type.lower(), field_name)
+def get_limit_offset_sql(limit, offset=None):
+ sql = "LIMIT %s" % limit
+ if offset and offset != 0:
+ sql += " OFFSET %s" % offset
+ return sql
+
def _sqlite_date_trunc(lookup_type, dt):
try:
dt = typecasts.typecast_timestamp(dt)