]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
more work on the types...
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 22 Sep 2005 05:15:51 +0000 (05:15 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 22 Sep 2005 05:15:51 +0000 (05:15 +0000)
lib/sqlalchemy/databases/sqlite.py

index 9bb84645155576d09934938b6ab95e3a1f27e00b..086354bc8870c99ab7d84f8cb036a2c45370952b 100644 (file)
@@ -53,26 +53,16 @@ class SLBoolean(sqltypes.Boolean):
         return "BOOLEAN"
         
 colspecs = {
-    sqltypes.INT : SLInteger,
-    sqltypes.CHAR : SLChar,
-    sqltypes.VARCHAR : SLString,
-    sqltypes.TEXT : SLText,
+    sqltypes.Integer : SLInteger,
     sqltypes.Numeric : SLNumeric,
-    sqltypes.TIMESTAMP : SLDateTime,
-    sqltypes.DATETIME : SLDateTime,
-    sqltypes.CLOB : SLText,
-    sqltypes.BLOB : SLBinary,
-    sqltypes.BOOLEAN : SLBoolean,
-    sqltypes.FLOAT : SLNumeric,
-    sqltypes.DECIMAL : SLNumeric,
+    sqltypes.DateTime : SLDateTime,
+    sqltypes.String : SLString,
+    sqltypes.Binary : SLBinary,
+    sqltypes.Boolean : SLBoolean,
+    sqltypes.TEXT : SLText,
+    sqltypes.CHAR: SLChar,
 }
 
-def type_descriptor(typeobj):
-    try:
-        return typeobj.typeself.adapt(colspecs[typeobj.typeclass])
-    except KeyError:
-        return typeobj.typeself.adapt(typeobj.typeclass)
-
 pragma_names = {
     'INTEGER' : SLInteger,
     'VARCHAR' : SLString,
@@ -98,7 +88,7 @@ class SQLiteSQLEngine(ansisql.ANSISQLEngine):
             self.context.last_inserted_ids = [cursor.lastrowid]
 
     def type_descriptor(self, typeobj):
-        return type_descriptor(typeobj)
+        return typeobj.typeself.type_descriptor(colspecs)
         
     def last_inserted_ids(self):
         return self.context.last_inserted_ids