summaryrefslogtreecommitdiff
path: root/test/sql/test_compare.py
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2019-12-19 19:58:52 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-03-24 14:05:19 -0400
commit8e3a05ab987dcb783385e555aa607248df1469ca (patch)
tree8b34847dcfd0e63cf56ed5e530254da19cb875ef /test/sql/test_compare.py
parente6b6ec78e6d6f96537eaf542f469a7e88134e9fc (diff)
downloadsqlalchemy-8e3a05ab987dcb783385e555aa607248df1469ca.tar.gz
Implement SQL VALUES in core.
Added a core :class:`Values` object that enables a VALUES construct to be used in the FROM clause of an SQL statement for databases that support it (mainly PostgreSQL and SQL Server). Fixes: #4868 Closes: #5030 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5030 Pull-request-sha: 84684038a8efa93b460318e0db53f6c644554588 Change-Id: Ib8109b63bc1a9dc04ab987c5322ca3375f7e824d
Diffstat (limited to 'test/sql/test_compare.py')
-rw-r--r--test/sql/test_compare.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/sql/test_compare.py b/test/sql/test_compare.py
index 185244094..b5fad54dc 100644
--- a/test/sql/test_compare.py
+++ b/test/sql/test_compare.py
@@ -25,6 +25,7 @@ from sqlalchemy import tuple_
from sqlalchemy import union
from sqlalchemy import union_all
from sqlalchemy import util
+from sqlalchemy import values
from sqlalchemy.dialects import mysql
from sqlalchemy.dialects import postgresql
from sqlalchemy.schema import Sequence
@@ -471,6 +472,43 @@ class CoreFixtures(object):
table("a", column("q"), column("y", Integer)),
),
lambda: (table_a, table_b),
+ lambda: (
+ values(
+ column("mykey", Integer),
+ column("mytext", String),
+ column("myint", Integer),
+ name="myvalues",
+ ).data([(1, "textA", 99), (2, "textB", 88)]),
+ values(
+ column("mykey", Integer),
+ column("mytext", String),
+ column("myint", Integer),
+ name="myothervalues",
+ ).data([(1, "textA", 99), (2, "textB", 88)]),
+ values(
+ column("mykey", Integer),
+ column("mytext", String),
+ column("myint", Integer),
+ name="myvalues",
+ ).data([(1, "textA", 89), (2, "textG", 88)]),
+ values(
+ column("mykey", Integer),
+ column("mynottext", String),
+ column("myint", Integer),
+ name="myvalues",
+ ).data([(1, "textA", 99), (2, "textB", 88)]),
+ # TODO: difference in type
+ # values(
+ # [
+ # column("mykey", Integer),
+ # column("mytext", Text),
+ # column("myint", Integer),
+ # ],
+ # (1, "textA", 99),
+ # (2, "textB", 88),
+ # alias_name="myvalues",
+ # ),
+ ),
]
dont_compare_values_fixtures = [