]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
inlined encoding of result column names
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Aug 2007 16:30:30 +0000 (16:30 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Aug 2007 16:30:30 +0000 (16:30 +0000)
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/default.py

index 9f8e8734eed95e2145882d0e3a97a871adcfc11c..78eb0922e609f90fa0e801ed96e85112ee5f8517 100644 (file)
@@ -1174,7 +1174,7 @@ class ResultProxy(object):
 
             for i, item in enumerate(metadata):
                 # sqlite possibly prepending table name to colnames so strip
-                colname = self.dialect.decode_result_columnname(item[0].split('.')[-1])
+                colname = (item[0].split('.')[-1]).decode(self.dialect.encoding)
                 if self.context.typemap is not None:
                     type = self.context.typemap.get(colname.lower(), typemap.get(item[1], types.NULLTYPE))
                 else:
index db22b8aaa4fa51231b0233991279af01622b3d04..a9ee02c1cd91eb69b4a97bedda3c01c968aa7e3f 100644 (file)
@@ -22,11 +22,6 @@ class DefaultDialect(base.Dialect):
         self.dbapi = dbapi
         self._figure_paramstyle(paramstyle=paramstyle, default=default_paramstyle)
     
-    def decode_result_columnname(self, name):
-        """decode a name found in cursor.description to a unicode object."""
-        
-        return name.decode(self.encoding)
-        
     def dbapi_type_map(self):
         # most DBAPIs have problems with this (such as, psycocpg2 types 
         # are unhashable).  So far Oracle can return it.