generated.sqltext, include_table=False, literal_binds=True
)
+ def visit_create_sequence(self, create, **kw):
+ prefix = None
+ if create.element.data_type is not None:
+ prefix = " AS %s" % self.type_compiler.process(
+ create.element.data_type
+ )
+
+ return super(PGDDLCompiler, self).visit_create_sequence(
+ create, prefix=prefix, **kw
+ )
+
class PGTypeCompiler(compiler.GenericTypeCompiler):
def visit_TSVECTOR(self, type_, **kw):
# coding: utf-8
from sqlalchemy import and_
+from sqlalchemy import BigInteger
from sqlalchemy import cast
from sqlalchemy import Column
from sqlalchemy import Computed
from sqlalchemy import schema
from sqlalchemy import select
from sqlalchemy import Sequence
+from sqlalchemy import SmallInteger
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
r = conn.execute(t.insert())
eq_(r.inserted_primary_key, (1,))
+ @testing.combinations(
+ (None, ""),
+ (Integer, "AS INTEGER "),
+ (SmallInteger, "AS SMALLINT "),
+ (BigInteger, "AS BIGINT "),
+ )
+ def test_create_index_concurrently(self, type_, text):
+ s = Sequence("s1", data_type=type_)
+ self.assert_compile(
+ schema.CreateSequence(s),
+ "CREATE SEQUENCE s1 %sSTART WITH 1" % text,
+ dialect=postgresql.dialect(),
+ )
+
class CompileTest(fixtures.TestBase, AssertsCompiledSQL):