From: Mike Bayer Date: Sun, 6 Dec 2009 23:45:19 +0000 (+0000) Subject: add a warning for unported dialects. considered a full blown NotImplementedError... X-Git-Tag: rel_0_6beta1~143 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=089dd19ca89628177011dbf909af51f5ab0eb4e9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add a warning for unported dialects. considered a full blown NotImplementedError but will see if this gets the message across --- diff --git a/doc/build/dbengine.rst b/doc/build/dbengine.rst index 156719f71c..c1f2c2850f 100644 --- a/doc/build/dbengine.rst +++ b/doc/build/dbengine.rst @@ -56,7 +56,8 @@ Recall that the ``Dialect`` is used to describe how to talk to a specific kind o Dialects included with SQLAlchemy fall under one of three categories: supported, experimental, and third party. Supported drivers are those which work against the most common databases available in the open source world, including SQLite, PostgreSQL, MySQL, and Firebird. Very popular commercial databases which provide easy access to test platforms are also supported, these currently include MSSQL and Oracle. These dialects are tested frequently and the level of support should be close to 100% for each. -The experimental category is for drivers against less common database platforms, or commercial platforms for which no freely available and easily usable test platform is provided. These include Access, MaxDB, Informix, and Sybase at the time of this writing. These are partially-functioning dialects for which the SQLAlchemy project is not able to provide regular test support. If you're interested in supporting one of these backends, contact the mailing list. +The experimental category is for drivers against less common database platforms, or commercial platforms for which no freely available and easily usable test platform is provided. These include Access, MaxDB, Informix, and Sybase at the time of this writing. These are not-yet-functioning +or partially-functioning dialects for which the SQLAlchemy project is not able to provide regular test support. If you're interested in supporting one of these backends, contact the mailing list. There are also third-party dialects available - currently IBM offers a DB2/Informix IDS dialect for SQLAlchemy. @@ -78,7 +79,7 @@ Downloads for each DBAPI at the time of this writing are as follows: - MSAccess: `pyodbc `_ - Informix: `informixdb `_ - Sybase: TODO - - MAXDB: TODO + - MAXDB: `sapdb `_ * Third Party Dialects - DB2/Informix IDS: `ibm-db `_ diff --git a/lib/sqlalchemy/databases/__init__.py b/lib/sqlalchemy/databases/__init__.py index 16cabd47f8..d7c6d7319c 100644 --- a/lib/sqlalchemy/databases/__init__.py +++ b/lib/sqlalchemy/databases/__init__.py @@ -17,8 +17,6 @@ from sqlalchemy.dialects.access import base as access from sqlalchemy.dialects.sybase import base as sybase - - __all__ = ( 'access', 'firebird', diff --git a/lib/sqlalchemy/dialects/access/base.py b/lib/sqlalchemy/dialects/access/base.py index ee61190ff4..f4e30f0bdb 100644 --- a/lib/sqlalchemy/dialects/access/base.py +++ b/lib/sqlalchemy/dialects/access/base.py @@ -178,6 +178,8 @@ class AccessDialect(default.DefaultDialect): supports_sane_rowcount = False supports_sane_multi_rowcount = False + ported_sqla_06 = False + def type_descriptor(self, typeobj): newobj = types.adapt_type(typeobj, self.colspecs) return newobj diff --git a/lib/sqlalchemy/dialects/informix/base.py b/lib/sqlalchemy/dialects/informix/base.py index 6565a812fe..9fbfbf0117 100644 --- a/lib/sqlalchemy/dialects/informix/base.py +++ b/lib/sqlalchemy/dialects/informix/base.py @@ -217,6 +217,8 @@ class InformixDialect(default.DefaultDialect): colspecs = colspecs ischema_names = ischema_names + ported_sqla_06 = False + def do_begin(self, connect): cu = connect.cursor() cu.execute('SET LOCK MODE TO WAIT') diff --git a/lib/sqlalchemy/dialects/maxdb/base.py b/lib/sqlalchemy/dialects/maxdb/base.py index d5f00dbdd1..9487ed7ed8 100644 --- a/lib/sqlalchemy/dialects/maxdb/base.py +++ b/lib/sqlalchemy/dialects/maxdb/base.py @@ -805,6 +805,8 @@ class MaxDBDialect(default.DefaultDialect): ddl_compiler = MaxDBDDLCompiler execution_ctx_cls = MaxDBExecutionContext + ported_sqla_06 = False + colspecs = colspecs ischema_names = ischema_names diff --git a/lib/sqlalchemy/dialects/sybase/base.py b/lib/sqlalchemy/dialects/sybase/base.py index cfdbd321ad..527cecd038 100644 --- a/lib/sqlalchemy/dialects/sybase/base.py +++ b/lib/sqlalchemy/dialects/sybase/base.py @@ -339,6 +339,8 @@ class SybaseDialect(default.DefaultDialect): ddl_compiler = SybaseDDLCompiler preparer = SybaseIdentifierPreparer + ported_sqla_06 = False + schema_name = "dba" def __init__(self, **params): diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 41470f3599..fecc16b3c7 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -70,6 +70,11 @@ class DefaultDialect(base.Dialect): encoding='utf-8', paramstyle=None, dbapi=None, implicit_returning=None, label_length=None, **kwargs): + + if not getattr(self, 'ported_sqla_06', True): + util.warn( + "The %s dialect is not yet ported to SQLAlchemy 0.6" % self.name) + self.convert_unicode = convert_unicode self.assert_unicode = assert_unicode self.encoding = encoding