summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-11-03 18:33:57 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-11-03 18:33:57 +0000
commite35dcee6ca9c12e5e78702ae7679796cbe8365f2 (patch)
tree7b9164469aa55b98206e90336832b179113bd734 /lib/sqlalchemy/dialects
parent56f64add8195f35961f67cf1baebda476dfb03ec (diff)
downloadsqlalchemy-e35dcee6ca9c12e5e78702ae7679796cbe8365f2.tar.gz
- The "start" and "increment" attributes on Sequence now
generate "START WITH" and "INCREMENT BY" by default, on Oracle and Postgresql. Firebird doesn't support these keywords right now. [ticket:1545]
Diffstat (limited to 'lib/sqlalchemy/dialects')
-rw-r--r--lib/sqlalchemy/dialects/firebird/base.py9
-rw-r--r--lib/sqlalchemy/dialects/oracle/base.py6
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py6
3 files changed, 8 insertions, 13 deletions
diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py
index 232583c39..921c70e98 100644
--- a/lib/sqlalchemy/dialects/firebird/base.py
+++ b/lib/sqlalchemy/dialects/firebird/base.py
@@ -271,7 +271,14 @@ class FBDDLCompiler(sql.compiler.DDLCompiler):
def visit_create_sequence(self, create):
"""Generate a ``CREATE GENERATOR`` statement for the sequence."""
-
+
+ # no syntax for these
+ # http://www.firebirdsql.org/manual/generatorguide-sqlsyntax.html
+ if create.element.start is not None:
+ raise NotImplemented("Firebird SEQUENCE doesn't support START WITH")
+ if create.element.increment is not None:
+ raise NotImplemented("Firebird SEQUENCE doesn't support INCREMENT BY")
+
if self.dialect._version_two:
return "CREATE SEQUENCE %s" % self.preparer.format_sequence(create.element)
else:
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py
index 7b141ed23..22ba2ce93 100644
--- a/lib/sqlalchemy/dialects/oracle/base.py
+++ b/lib/sqlalchemy/dialects/oracle/base.py
@@ -441,12 +441,6 @@ class OracleCompiler(compiler.SQLCompiler):
class OracleDDLCompiler(compiler.DDLCompiler):
- def visit_create_sequence(self, create):
- return "CREATE SEQUENCE %s" % self.preparer.format_sequence(create.element)
-
- def visit_drop_sequence(self, drop):
- return "DROP SEQUENCE %s" % self.preparer.format_sequence(drop.element)
-
def define_constraint_cascades(self, constraint):
text = ""
if constraint.ondelete is not None:
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index bc8cff905..97108b3cb 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -340,12 +340,6 @@ class PGDDLCompiler(compiler.DDLCompiler):
colspec += " NOT NULL"
return colspec
- def visit_create_sequence(self, create):
- return "CREATE SEQUENCE %s" % self.preparer.format_sequence(create.element)
-
- def visit_drop_sequence(self, drop):
- return "DROP SEQUENCE %s" % self.preparer.format_sequence(drop.element)
-
def visit_enum_constraint(self, constraint):
if not constraint.type.native_enum:
return super(PGDDLCompiler, self).visit_enum_constraint(constraint)