diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-01-16 21:04:32 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-01-16 21:04:32 -0500 |
| commit | 7fedf9958687222a9e3c2fc4d50983711dbb3d52 (patch) | |
| tree | 921320393422f906e75451376b41b3406abacef4 /lib/sqlalchemy/dialects/sqlite/base.py | |
| parent | 87002643407f886f13a3b53283ea0b6dafa695cc (diff) | |
| download | sqlalchemy-7fedf9958687222a9e3c2fc4d50983711dbb3d52.tar.gz | |
:class:`.Index` now supports arbitrary SQL expressions and/or
functions, in addition to straight columns. Common modifiers
include using ``somecolumn.desc()`` for a descending index and
``func.lower(somecolumn)`` for a case-insensitive index, depending on the
capabilities of the target backend.
[ticket:695]
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/sqlite/base.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 241d0bcdf..7558acccc 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -522,18 +522,8 @@ class SQLiteDDLCompiler(compiler.DDLCompiler): return preparer.format_table(table, use_schema=False) def visit_create_index(self, create): - index = create.element - preparer = self.preparer - text = "CREATE " - if index.unique: - text += "UNIQUE " - text += "INDEX %s ON %s (%s)" \ - % (preparer.format_index(index, - name=self._index_identifier(index.name)), - preparer.format_table(index.table, use_schema=False), - ', '.join(preparer.quote(c.name, c.quote) - for c in index.columns)) - return text + return super(SQLiteDDLCompiler, self).\ + visit_create_index(create, include_table_schema=False) class SQLiteTypeCompiler(compiler.GenericTypeCompiler): |
