diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-14 19:31:30 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-14 19:31:30 -0400 |
| commit | 9b597425c9e66d1c3ceada5f4e1bb6014f6de2c8 (patch) | |
| tree | 39261850f16da321262548cf79fafba0620dcd5a /lib/sqlalchemy/dialects/postgresql | |
| parent | 127c02747c519c8e487a01c55a1b407c7e00ede1 (diff) | |
| download | sqlalchemy-9b597425c9e66d1c3ceada5f4e1bb6014f6de2c8.tar.gz | |
- name all the "sub" dialect components <DB><component>_<dialectname>, [ticket:1738]
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/pg8000.py | 16 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg2.py | 18 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/pypostgresql.py | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/zxjdbc.py | 4 |
4 files changed, 23 insertions, 23 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index 079b05530..9824ab104 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -50,11 +50,11 @@ class _PGNumeric(sqltypes.Numeric): else: raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype) -class PostgreSQL_pg8000ExecutionContext(PGExecutionContext): +class PGExecutionContext_pg8000(PGExecutionContext): pass -class PostgreSQL_pg8000Compiler(PGCompiler): +class PGCompiler_pg8000(PGCompiler): def visit_mod(self, binary, **kw): return self.process(binary.left) + " %% " + self.process(binary.right) @@ -65,13 +65,13 @@ class PostgreSQL_pg8000Compiler(PGCompiler): return text.replace('%', '%%') -class PostgreSQL_pg8000IdentifierPreparer(PGIdentifierPreparer): +class PGIdentifierPreparer_pg8000(PGIdentifierPreparer): def _escape_identifier(self, value): value = value.replace(self.escape_quote, self.escape_to_quote) return value.replace('%', '%%') -class PostgreSQL_pg8000(PGDialect): +class PGDialect_pg8000(PGDialect): driver = 'pg8000' supports_unicode_statements = True @@ -80,9 +80,9 @@ class PostgreSQL_pg8000(PGDialect): default_paramstyle = 'format' supports_sane_multi_rowcount = False - execution_ctx_cls = PostgreSQL_pg8000ExecutionContext - statement_compiler = PostgreSQL_pg8000Compiler - preparer = PostgreSQL_pg8000IdentifierPreparer + execution_ctx_cls = PGExecutionContext_pg8000 + statement_compiler = PGCompiler_pg8000 + preparer = PGIdentifierPreparer_pg8000 colspecs = util.update_copy( PGDialect.colspecs, @@ -105,4 +105,4 @@ class PostgreSQL_pg8000(PGDialect): def is_disconnect(self, e): return "connection is closed" in str(e) -dialect = PostgreSQL_pg8000 +dialect = PGDialect_pg8000 diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 712124288..48349834d 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -102,7 +102,7 @@ SERVER_SIDE_CURSOR_RE = re.compile( r'\s*SELECT', re.I | re.UNICODE) -class PostgreSQL_psycopg2ExecutionContext(PGExecutionContext): +class PGExecutionContext_psycopg2(PGExecutionContext): def create_cursor(self): # TODO: coverage for server side cursors + select.for_update() @@ -136,7 +136,7 @@ class PostgreSQL_psycopg2ExecutionContext(PGExecutionContext): return base.ResultProxy(self) -class PostgreSQL_psycopg2Compiler(PGCompiler): +class PGCompiler_psycopg2(PGCompiler): def visit_mod(self, binary, **kw): return self.process(binary.left) + " %% " + self.process(binary.right) @@ -144,19 +144,19 @@ class PostgreSQL_psycopg2Compiler(PGCompiler): return text.replace('%', '%%') -class PostgreSQL_psycopg2IdentifierPreparer(PGIdentifierPreparer): +class PGIdentifierPreparer_psycopg2(PGIdentifierPreparer): def _escape_identifier(self, value): value = value.replace(self.escape_quote, self.escape_to_quote) return value.replace('%', '%%') -class PostgreSQL_psycopg2(PGDialect): +class PGDialect_psycopg2(PGDialect): driver = 'psycopg2' supports_unicode_statements = False default_paramstyle = 'pyformat' supports_sane_multi_rowcount = False - execution_ctx_cls = PostgreSQL_psycopg2ExecutionContext - statement_compiler = PostgreSQL_psycopg2Compiler - preparer = PostgreSQL_psycopg2IdentifierPreparer + execution_ctx_cls = PGExecutionContext_psycopg2 + statement_compiler = PGCompiler_psycopg2 + preparer = PGIdentifierPreparer_psycopg2 colspecs = util.update_copy( PGDialect.colspecs, @@ -191,7 +191,7 @@ class PostgreSQL_psycopg2(PGDialect): return extensions.register_type(extensions.UNICODE, conn) pool.add_listener({'first_connect': connect, 'connect':connect}) - super(PostgreSQL_psycopg2, self).visit_pool(pool) + super(PGDialect_psycopg2, self).visit_pool(pool) def create_connect_args(self, url): opts = url.translate_connect_args(username='user') @@ -211,5 +211,5 @@ class PostgreSQL_psycopg2(PGDialect): else: return False -dialect = PostgreSQL_psycopg2 +dialect = PGDialect_psycopg2 diff --git a/lib/sqlalchemy/dialects/postgresql/pypostgresql.py b/lib/sqlalchemy/dialects/postgresql/pypostgresql.py index 87582a6cd..2e7ea201c 100644 --- a/lib/sqlalchemy/dialects/postgresql/pypostgresql.py +++ b/lib/sqlalchemy/dialects/postgresql/pypostgresql.py @@ -24,10 +24,10 @@ class PGNumeric(sqltypes.Numeric): else: return processors.to_float -class PostgreSQL_pypostgresqlExecutionContext(PGExecutionContext): +class PGExecutionContext_pypostgresql(PGExecutionContext): pass -class PostgreSQL_pypostgresql(PGDialect): +class PGDialect_pypostgresql(PGDialect): driver = 'pypostgresql' supports_unicode_statements = True @@ -40,7 +40,7 @@ class PostgreSQL_pypostgresql(PGDialect): supports_sane_rowcount = True supports_sane_multi_rowcount = False - execution_ctx_cls = PostgreSQL_pypostgresqlExecutionContext + execution_ctx_cls = PGExecutionContext_pypostgresql colspecs = util.update_copy( PGDialect.colspecs, { @@ -66,4 +66,4 @@ class PostgreSQL_pypostgresql(PGDialect): def is_disconnect(self, e): return "connection is closed" in str(e) -dialect = PostgreSQL_pypostgresql +dialect = PGDialect_pypostgresql diff --git a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py index 02cce4504..a886901c8 100644 --- a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py @@ -9,11 +9,11 @@ The official Postgresql JDBC driver is at http://jdbc.postgresql.org/. from sqlalchemy.connectors.zxJDBC import ZxJDBCConnector from sqlalchemy.dialects.postgresql.base import PGDialect -class PostgreSQL_zxjdbc(ZxJDBCConnector, PGDialect): +class PGDialect_zxjdbc(ZxJDBCConnector, PGDialect): 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_zxjdbc +dialect = PGDialect_zxjdbc |
