summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 088ca1969..6802bfbef 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1024,7 +1024,18 @@ class DDLCompiler(engine.Compiled):
self.preparer.format_table(create.element.table),
self.process(create.element)
)
+
+ def visit_create_sequence(self, create):
+ text = "CREATE SEQUENCE %s" % self.preparer.format_sequence(create.element)
+ if create.element.increment is not None:
+ text += " INCREMENT BY %d" % create.element.increment
+ if create.element.start is not None:
+ text += " START WITH %d" % create.element.start
+ return text
+ def visit_drop_sequence(self, drop):
+ return "DROP SEQUENCE %s" % self.preparer.format_sequence(drop.element)
+
def visit_drop_constraint(self, drop):
preparer = self.preparer
return "ALTER TABLE %s DROP CONSTRAINT %s%s" % (