Extends `AUTOCOMMIT_REGEXP` for the postgres dialect to include `GRANT` and `REVOKE`.
Change-Id: Iba15f1ebf5bd7bc0fc1193fdf561417e53bf5d57
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/357
infrequently hitting a weakref that has not been fully acted upon
after gc.
+ .. change::
+ :tags: bug, postgresql
+ :versions: 1.2.0b1
+
+ Added "autocommit" support for GRANT, REVOKE keywords. Pull request
+ courtesy Jacob Hayes.
+
.. change:: 3966
:tags: bug, mysql
:versions: 1.2.0b1
DATE, BOOLEAN, REAL
AUTOCOMMIT_REGEXP = re.compile(
- r'\s*(?:UPDATE|INSERT|CREATE|DELETE|DROP|ALTER|'
+ r'\s*(?:UPDATE|INSERT|CREATE|DELETE|DROP|ALTER|GRANT|REVOKE|'
'IMPORT FOREIGN SCHEMA|REFRESH MATERIALIZED VIEW)',
re.I | re.UNICODE)
class AutocommitTextTest(test_execute.AutocommitTextTest):
__only_on__ = 'postgresql'
+ def test_grant(self):
+ self._test_keyword("GRANT USAGE ON SCHEMA fooschema TO foorole")
+
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")
+
+ def test_revoke(self):
+ self._test_keyword("REVOKE USAGE ON SCHEMA fooschema FROM foorole")