summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/sqlite/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-03-10 14:18:35 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-03-10 14:18:35 -0400
commit6ac0555eaa6363ac9d0ad6566248dd294ad61d9e (patch)
tree4a54440ed768c5b848f29d7efa7fe2020fbc9a23 /lib/sqlalchemy/dialects/sqlite/base.py
parentddf35e2f04c592256762d5f79ee9e13e4d0b5818 (diff)
downloadsqlalchemy-6ac0555eaa6363ac9d0ad6566248dd294ad61d9e.tar.gz
- changelog / doc for sqlite partial indexes
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite/base.py')
-rw-r--r--lib/sqlalchemy/dialects/sqlite/base.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py
index 437a7794a..462a9f21f 100644
--- a/lib/sqlalchemy/dialects/sqlite/base.py
+++ b/lib/sqlalchemy/dialects/sqlite/base.py
@@ -272,6 +272,26 @@ lookup is used instead:
.. versionadded:: 0.9.3 Support for SQLite type affinity rules when reflecting
columns.
+
+.. _sqlite_partial_index:
+
+Partial Indexes
+===============
+
+A partial index, e.g. one which uses a WHERE clause, can be specified
+with the DDL system using the argument ``sqlite_where``::
+
+ tbl = Table('testtbl', m, Column('data', Integer))
+ idx = Index('test_idx1', tbl.c.data,
+ sqlite_where=and_(tbl.c.data > 5, tbl.c.data < 10))
+
+The index will be rendered at create time as::
+
+ CREATE INDEX test_idx1 ON testtbl (data)
+ WHERE data > 5 AND data < 10
+
+.. versionadded:: 0.9.9
+
"""
import datetime