summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--lib/sqlalchemy/databases/sqlite.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 94a925cae..0a1990ea1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -107,6 +107,8 @@
- the fix in "schema" above fixes reflection of foreign keys from an
alt-schema table to a public schema table
- sqlite
+ - rearranged dialect initialization so it has time to warn about pysqlite1
+ being too old.
- sqlite better handles datetime/date/time objects mixed and matched
with various Date/Time/DateTime columns
- string PK column inserts dont get overwritten with OID [ticket:603]
diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py
index 8e776fb26..b42468c7a 100644
--- a/lib/sqlalchemy/databases/sqlite.py
+++ b/lib/sqlalchemy/databases/sqlite.py
@@ -159,13 +159,13 @@ class SQLiteDialect(ansisql.ANSIDialect):
ansisql.ANSIDialect.__init__(self, default_paramstyle='qmark', **kwargs)
def vers(num):
return tuple([int(x) for x in num.split('.')])
- self.supports_cast = (self.dbapi is None or vers(self.dbapi.sqlite_version) >= vers("3.2.3"))
if self.dbapi is not None:
sqlite_ver = self.dbapi.version_info
if sqlite_ver < (2,1,'3'):
warnings.warn(RuntimeWarning("The installed version of pysqlite2 (%s) is out-dated, and will cause errors in some cases. Version 2.1.3 or greater is recommended." % '.'.join([str(subver) for subver in sqlite_ver])))
if vers(self.dbapi.sqlite_version) < vers("3.3.13"):
warnings.warn(RuntimeWarning("The installed version of sqlite (%s) is out-dated, and will cause errors in some cases. Version 3.3.13 or greater is recommended." % self.dbapi.sqlite_version))
+ self.supports_cast = (self.dbapi is None or vers(self.dbapi.sqlite_version) >= vers("3.2.3"))
def dbapi(cls):
try: