summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index c20498b2d..2dd64d9bc 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -454,7 +454,20 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
dialect=postgresql.dialect(),
)
+ idx3 = Index(
+ "test_idx2",
+ tbl.c.data,
+ postgresql_where="data > 'a' AND data < 'b''s'",
+ )
+ self.assert_compile(
+ schema.CreateIndex(idx3),
+ "CREATE INDEX test_idx2 ON testtbl (data) "
+ "WHERE data > 'a' AND data < 'b''s'",
+ dialect=postgresql.dialect(),
+ )
+
def test_create_index_with_ops(self):
+
m = MetaData()
tbl = Table(
"testtbl",
@@ -1646,7 +1659,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
series = func.generate_series(1, 100).alias("series")
series_col = column("series")
query = select(
- [func.array_agg(series_col).filter(series_col % 2 == 0)[3]]
+ func.array_agg(series_col).filter(series_col % 2 == 0)[3]
).select_from(series)
self.assert_compile(
query,
@@ -2171,22 +2184,22 @@ class DistinctOnTest(fixtures.TestBase, AssertsCompiledSQL):
def test_plain_inline(self):
self.assert_compile(
- select([self.table], distinct=True),
+ select(self.table).distinct(),
"SELECT DISTINCT t.id, t.a, t.b FROM t",
)
def test_on_columns_inline_list(self):
self.assert_compile(
- select(
- [self.table], distinct=[self.table.c.a, self.table.c.b]
- ).order_by(self.table.c.a, self.table.c.b),
+ select(self.table)
+ .distinct(self.table.c.a, self.table.c.b)
+ .order_by(self.table.c.a, self.table.c.b),
"SELECT DISTINCT ON (t.a, t.b) t.id, "
"t.a, t.b FROM t ORDER BY t.a, t.b",
)
def test_on_columns_inline_scalar(self):
self.assert_compile(
- select([self.table], distinct=self.table.c.a),
+ select(self.table).distinct(self.table.c.a),
"SELECT DISTINCT ON (t.a) t.id, t.a, t.b FROM t",
)