summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-09-12 19:46:50 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-09-12 19:46:50 +0000
commit645be4aa24a06241dfeb635aee8ca7a09574d800 (patch)
tree39154cee5c26db4698df344fb41ed91344284b87 /test/dialect/postgresql/test_compiler.py
parenta2f2863f5af934a94ed96539e852cb874c3203c0 (diff)
parent1a08d1aade046e9516d0527ffd2ac8bb43906171 (diff)
downloadsqlalchemy-645be4aa24a06241dfeb635aee8ca7a09574d800.tar.gz
Merge "Improve handling of covering indexes"
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 30541ab06..2dd64d9bc 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -1734,6 +1734,34 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
"(INCREMENT BY 7 START WITH 4))",
)
+ def test_index_extra_include_1(self):
+ metadata = MetaData()
+ tbl = Table(
+ "test",
+ metadata,
+ Column("x", Integer),
+ Column("y", Integer),
+ Column("z", Integer),
+ )
+ idx = Index("foo", tbl.c.x, postgresql_include=["y"])
+ self.assert_compile(
+ schema.CreateIndex(idx), "CREATE INDEX foo ON test (x) INCLUDE (y)"
+ )
+
+ def test_index_extra_include_2(self):
+ metadata = MetaData()
+ tbl = Table(
+ "test",
+ metadata,
+ Column("x", Integer),
+ Column("y", Integer),
+ Column("z", Integer),
+ )
+ idx = Index("foo", tbl.c.x, postgresql_include=[tbl.c.y])
+ self.assert_compile(
+ schema.CreateIndex(idx), "CREATE INDEX foo ON test (x) INCLUDE (y)"
+ )
+
class InsertOnConflictTest(fixtures.TestBase, AssertsCompiledSQL):
__dialect__ = postgresql.dialect()