diff options
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 20732067d..708dbe147 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -1,6 +1,7 @@ # coding: utf-8 from sqlalchemy import and_ +from sqlalchemy import BigInteger from sqlalchemy import cast from sqlalchemy import Column from sqlalchemy import Computed @@ -15,6 +16,7 @@ from sqlalchemy import null 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 @@ -92,6 +94,20 @@ class SequenceTest(fixtures.TestBase, AssertsCompiledSQL): 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): @@ -1234,6 +1250,27 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "%(param_1)s = ANY (x)", checkparams={"param_1": 4}, ) + + self.assert_compile( + c.any(5), "%(param_1)s = ANY (x)", checkparams={"param_1": 5}, + ) + + self.assert_compile( + ~c.any(5), + "NOT (%(param_1)s = ANY (x))", + checkparams={"param_1": 5}, + ) + + self.assert_compile( + c.all(5), "%(param_1)s = ALL (x)", checkparams={"param_1": 5}, + ) + + self.assert_compile( + ~c.all(5), + "NOT (%(param_1)s = ALL (x))", + checkparams={"param_1": 5}, + ) + self.assert_compile( c.any(5, operator=operators.ne), "%(param_1)s != ANY (x)", |