Open sqlalchemy-bot opened 9 years ago
Michael Bayer (zzzeek) wrote:
#!diff
diff --git a/lib/sqlalchemy/dialects/postgresql/__init__.py b/lib/sqlalchemy/dialects/postgresql/__init__.py
index 98fe6f0..dfa27a9 100644
--- a/lib/sqlalchemy/dialects/postgresql/__init__.py
+++ b/lib/sqlalchemy/dialects/postgresql/__init__.py
@@ -6,8 +6,11 @@
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import base, psycopg2, pg8000, pypostgresql, zxjdbc, psycopg2cffi
+import imp
base.dialect = psycopg2.dialect
+generic = imp.new_module("generic")
+generic.dialect = base.generic
from .base import \
INTEGER, BIGINT, SMALLINT, VARCHAR, CHAR, TEXT, NUMERIC, FLOAT, REAL, \
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 22c66db..94c629a 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -2875,3 +2875,5 @@ class PGDialect(default.DefaultDialect):
}
return domains
+
+generic = PGDialect
Michael Bayer (zzzeek) wrote:
perhaps just a compiler flag "sqlscript=True" or something like that
Changes by Michael Bayer (zzzeek):
Migrated issue, originally created by Michael Bayer (zzzeek)
The psycopg2 dialect doubles up percent signs. in offline mode, there's no DBAPI thus we should use the default dialect minus DBAPI. However SQLAlchemy does not expose this. We may want upstream SQLA to support a url of the form "postgresql+generic://" to make this possible, but the solution should be agnostic of backend (still might require adding the name "generic" to each module).