diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-02-13 14:20:38 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-02-13 14:45:40 -0500 |
commit | 3b6004e6ab3fef8e37fb42981c02f4dfa34fe3b7 (patch) | |
tree | 1b259c32e5b425ad0373f6d24e9b4fa2b7d415d2 /test | |
parent | f107dd78eccb9a6d38d84364d9efd6ad5e1c71da (diff) | |
download | sqlalchemy-3b6004e6ab3fef8e37fb42981c02f4dfa34fe3b7.tar.gz |
Add new DDL autocommit expressions for Postgresql
Added regular expressions for the "IMPORT FOREIGN SCHEMA",
"REFRESH MATERIALIZED VIEW" Postgresql statements so that they
autocommit when invoked via a connection or engine without
an explicit transaction. Pull requests courtesy Frazer McLean
and Paweł Stiasny.
Fixes: #3840
Co-authored-by: Frazer McLean
Co-authored-by: Paweł Stiasny
Change-Id: I92b2b61683d29d57fa23a66a3559120cb1241c2f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/323
Diffstat (limited to 'test')
-rw-r--r-- | test/dialect/postgresql/test_dialect.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index ba68faf16..a9ef09dbd 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -18,6 +18,7 @@ from sqlalchemy.engine import engine_from_config from sqlalchemy.engine import url from sqlalchemy.testing import is_ from sqlalchemy.testing import expect_deprecated +from ...engine import test_execute class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL): @@ -295,3 +296,13 @@ class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL): ddl_compiler.get_column_specification(t.c.c), "c %s NOT NULL" % expected ) + + +class AutocommitTextTest(test_execute.AutocommitTextTest): + __only_on__ = 'postgresql' + + def test_import_foreign_schema(self): + self._test_keyword("IMPORT FOREIGN SCHEMA foob") + + def test_refresh_view(self): + self._test_keyword("REFRESH MATERIALIZED VIEW fooview") |