diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2020-08-21 21:39:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-08-21 21:39:40 +0000 |
commit | 317f2e1be2b06cdc12bc84510eb743d9752763dd (patch) | |
tree | acf50269494e5a14ec58ef87e511a8a93f1b263d /test/dialect/postgresql/test_compiler.py | |
parent | 9b6b867fe59d74c23edca782dcbba9af99b62817 (diff) | |
parent | 26e8d3b5bdee50192e3426fba48e6b326e428e0b (diff) | |
download | sqlalchemy-317f2e1be2b06cdc12bc84510eb743d9752763dd.tar.gz |
Merge "Add support for identity columns"
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 708dbe147..6196b52f2 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -9,6 +9,7 @@ from sqlalchemy import delete from sqlalchemy import Enum from sqlalchemy import exc from sqlalchemy import func +from sqlalchemy import Identity from sqlalchemy import Index from sqlalchemy import Integer from sqlalchemy import MetaData @@ -1705,6 +1706,20 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): dialect=postgresql.dialect(), ) + def test_column_identity(self): + # all other tests are in test_identity_column.py + m = MetaData() + t = Table( + "t", + m, + Column("y", Integer, Identity(always=True, start=4, increment=7)), + ) + self.assert_compile( + schema.CreateTable(t), + "CREATE TABLE t (y INTEGER GENERATED ALWAYS AS IDENTITY " + "(INCREMENT BY 7 START WITH 4))", + ) + class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = postgresql.dialect() |