summaryrefslogtreecommitdiff
path: root/adbh.py
diff options
context:
space:
mode:
authorSylvain Thenault <sylvain.thenault@logilab.fr>2008-09-29 10:27:21 +0200
committerSylvain Thenault <sylvain.thenault@logilab.fr>2008-09-29 10:27:21 +0200
commit4f1b2f21d46d305508bfe469e0da9ca1ca520ef7 (patch)
tree77d1909df904d35e155fbd5aa063da391a9582ee /adbh.py
parentef0938b73adafcfadb3b4e4de085c38b5dd1f08c (diff)
downloadlogilab-common-4f1b2f21d46d305508bfe469e0da9ca1ca520ef7.tar.gz
sqlite specific implementation for sql_[create|drop]_index
Diffstat (limited to 'adbh.py')
-rw-r--r--adbh.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/adbh.py b/adbh.py
index 828d870..7aeb1e4 100644
--- a/adbh.py
+++ b/adbh.py
@@ -427,6 +427,16 @@ class _SqliteAdvFuncHelper(_GenericAdvFuncHelper):
ilike_support = False
union_parentheses_support = False
+ def sql_create_index(self, table, column, unique=False):
+ idx = self._index_name(table, column, unique)
+ if unique:
+ return 'CREATE UNIQUE INDEX %s ON %s(%s);' % (idx, table, column)
+ else:
+ return 'CREATE INDEX %s ON %s(%s);' % (idx, table, column)
+
+ def sql_drop_index(self, table, column, unique=False):
+ return 'DROP INDEX %s' % self._index_name(table, column, unique)
+
def list_tables(self, cursor):
"""return the list of tables of a database"""
# filter type='table' else we get indices as well