summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/zxjdbc.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-08-06 21:11:27 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-08-06 21:11:27 +0000
commit8fc5005dfe3eb66a46470ad8a8c7b95fc4d6bdca (patch)
treeae9e27d12c9fbf8297bb90469509e1cb6a206242 /lib/sqlalchemy/dialects/postgresql/zxjdbc.py
parent7638aa7f242c6ea3d743aa9100e32be2052546a6 (diff)
downloadsqlalchemy-8fc5005dfe3eb66a46470ad8a8c7b95fc4d6bdca.tar.gz
merge 0.6 series to trunk.
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/zxjdbc.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/zxjdbc.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py
new file mode 100644
index 000000000..b707d2d9e
--- /dev/null
+++ b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py
@@ -0,0 +1,28 @@
+"""Support for the PostgreSQL database via the zxjdbc JDBC connector.
+
+JDBC Driver
+-----------
+
+The official Postgresql JDBC driver is at http://jdbc.postgresql.org/.
+
+"""
+from sqlalchemy.connectors.zxJDBC import ZxJDBCConnector
+from sqlalchemy.dialects.postgresql.base import PGCompiler, PGDialect
+
+class PostgreSQL_jdbcCompiler(PGCompiler):
+
+ def post_process_text(self, text):
+ # Don't escape '%' like PGCompiler
+ return text
+
+
+class PostgreSQL_jdbc(ZxJDBCConnector, PGDialect):
+ statement_compiler = PostgreSQL_jdbcCompiler
+
+ jdbc_db_name = 'postgresql'
+ jdbc_driver_name = 'org.postgresql.Driver'
+
+ def _get_server_version_info(self, connection):
+ return tuple(int(x) for x in connection.connection.dbversion.split('.'))
+
+dialect = PostgreSQL_jdbc