diff options
author | Adrien Di Mascio <adim@logilab.fr> | 2006-05-15 15:09:45 +0200 |
---|---|---|
committer | Adrien Di Mascio <adim@logilab.fr> | 2006-05-15 15:09:45 +0200 |
commit | d5eccd938adafa6b8ae0fabf017cfc220527ee08 (patch) | |
tree | 6481dadf24be02c301cdecd91d54184231e29759 | |
parent | 178ba3b2e9a1cadad0bd2f9bbaf1de796d9b369e (diff) | |
download | logilab-common-d5eccd938adafa6b8ae0fabf017cfc220527ee08.tar.gz |
simple psycopg2 adapter (will have to improve that later)
-rw-r--r-- | db.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -195,6 +195,11 @@ class _PsycopgAdapter(DBAPIAdapter): return self._wrap_if_needed(cnx) +class _Psycopg2Adapter(_PsycopgAdapter): + """Simple Psycopg2 Adapter to DBAPI (cnx_string differs from classical ones) + """ + BOOLEAN = 16 # XXX + class _PgsqlAdapter(DBAPIAdapter): """Simple pyPgSQL Adapter to DBAPI @@ -425,7 +430,7 @@ class _SqliteAdvFuncHelper(_GenericAdvFuncHelper): PREFERED_DRIVERS = { - "postgres" : [ 'psycopg', 'pgdb', 'pyPgSQL.PgSQL', ], + "postgres" : [ 'psycopg', 'psycopg2', 'pgdb', 'pyPgSQL.PgSQL', ], "mysql" : [ 'MySQLdb', ], # 'pyMySQL.MySQL, ], "sqlite" : [ 'pysqlite2.dbapi2', 'sqlite', ], } @@ -433,6 +438,7 @@ PREFERED_DRIVERS = { _ADAPTERS = { 'postgres' : { 'pgdb' : _PgdbAdapter, 'psycopg' : _PsycopgAdapter, + 'psycopg2' : _Psycopg2Adapter, 'pyPgSQL.PgSQL' : _PgsqlAdapter, }, 'mysql' : { 'MySQLdb' : _MySqlDBAdapter, }, |