summaryrefslogtreecommitdiff
path: root/test/dialect/oracle/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-08-03 14:08:32 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-08-03 20:47:27 -0400
commitf684bb7659ff195d4c55414162c1de4fbfdafc2f (patch)
treef5bb7d7a4d2e03af9470ed2c539acd33ae6462d9 /test/dialect/oracle/test_compiler.py
parentea6fb4ff5bcffcf71cdbc587504f10f03fe921ca (diff)
downloadsqlalchemy-f684bb7659ff195d4c55414162c1de4fbfdafc2f.tar.gz
ensure RETURNING renders in stringify w/ no server version
just in my own testing, if I say insert().return_defaults() and stringify, I should see it, so make sure all the dialects default to "insert_returning" etc. , with downgrade on server version check. Change-Id: Id64e78fcb03c48b5dcb0feb21cb9cc495edd15e9
Diffstat (limited to 'test/dialect/oracle/test_compiler.py')
-rw-r--r--test/dialect/oracle/test_compiler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/dialect/oracle/test_compiler.py b/test/dialect/oracle/test_compiler.py
index 45a83ed77..96969b459 100644
--- a/test/dialect/oracle/test_compiler.py
+++ b/test/dialect/oracle/test_compiler.py
@@ -57,6 +57,22 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
self.assert_compile(sql.false(), "0")
self.assert_compile(sql.true(), "1")
+ def test_plain_stringify_returning(self):
+ t = Table(
+ "t",
+ MetaData(),
+ Column("myid", Integer, primary_key=True),
+ Column("name", String, server_default="some str"),
+ Column("description", String, default=func.lower("hi")),
+ )
+ stmt = t.insert().values().return_defaults()
+ eq_ignore_whitespace(
+ str(stmt.compile(dialect=oracle.OracleDialect())),
+ "INSERT INTO t (description) VALUES (lower(:lower_1)) "
+ "RETURNING t.myid, t.name, t.description "
+ "INTO :ret_0, :ret_1, :ret_2",
+ )
+
def test_owner(self):
meta = MetaData()
parent = Table(