diff options
author | Sylvain Thenault <sylvain.thenault@logilab.fr> | 2008-09-29 10:27:21 +0200 |
---|---|---|
committer | Sylvain Thenault <sylvain.thenault@logilab.fr> | 2008-09-29 10:27:21 +0200 |
commit | 4f1b2f21d46d305508bfe469e0da9ca1ca520ef7 (patch) | |
tree | 77d1909df904d35e155fbd5aa063da391a9582ee /adbh.py | |
parent | ef0938b73adafcfadb3b4e4de085c38b5dd1f08c (diff) | |
download | logilab-common-4f1b2f21d46d305508bfe469e0da9ca1ca520ef7.tar.gz |
sqlite specific implementation for sql_[create|drop]_index
Diffstat (limited to 'adbh.py')
-rw-r--r-- | adbh.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |