]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add CHAR to ischema_names map; some minor cleanup
authorJonathan Ellis <jbellis@gmail.com>
Tue, 20 May 2008 21:30:11 +0000 (21:30 +0000)
committerJonathan Ellis <jbellis@gmail.com>
Tue, 20 May 2008 21:30:11 +0000 (21:30 +0000)
lib/sqlalchemy/databases/oracle.py

index 2f69f8fd93e83f2229b9b6f0a15c22d65354f031..45bbe2ea43c78c5f96cf23ab1d3041d6cb0c1f5b 100644 (file)
@@ -175,6 +175,7 @@ colspecs = {
 
 ischema_names = {
     'VARCHAR2' : OracleString,
+    'CHAR' : OracleString,
     'DATE' : OracleDateTime,
     'DATETIME' : OracleDateTime,
     'NUMBER' : OracleNumeric,
@@ -358,11 +359,11 @@ class OracleDialect(default.DefaultDialect):
 
     def has_table(self, connection, table_name, schema=None):
         cursor = connection.execute("""select table_name from all_tables where table_name=:name""", {'name':self._denormalize_name(table_name)})
-        return bool( cursor.fetchone() is not None )
+        return cursor.fetchone() is not None
 
     def has_sequence(self, connection, sequence_name):
         cursor = connection.execute("""select sequence_name from all_sequences where sequence_name=:name""", {'name':self._denormalize_name(sequence_name)})
-        return bool( cursor.fetchone() is not None )
+        return cursor.fetchone() is not None
 
     def _normalize_name(self, name):
         if name is None:
@@ -460,9 +461,7 @@ class OracleDialect(default.DefaultDialect):
             row = c.fetchone()
             if row is None:
                 break
-            found_table = True
 
-            #print "ROW:" , row
             (colname, coltype, length, precision, scale, nullable, default) = (self._normalize_name(row[0]), row[1], row[2], row[3], row[4], row[5]=='Y', row[6])
 
             if include_columns and colname not in include_columns: