def visit_create_index(self, create):
index = create.element
self._verify_index_table(index)
preparer = self.preparer
text = "CREATE "
if index.unique:
text += "UNIQUE "
if index.dialect_options['oracle']['bitmap']:
text += "BITMAP "
text += "INDEX %s ON %s (%s)" % (
self._prepared_index_name(index, include_schema=True),
preparer.format_table(index.table, use_schema=True),
', '.join(
self.sql_compiler.process(
expr,
include_table=False, literal_binds=True)
for expr in index.expressions)
)
if index.dialect_options['oracle']['compress'] is not False:
if index.dialect_options['oracle']['compress'] is True:
text += " COMPRESS"
else:
text += " COMPRESS %d" % (
index.dialect_options['oracle']['compress']
)
return text
评论列表
文章目录