Commits

Mike Bayer committed 11acff2

inlined encoding of result column names

Comments (0)

Files changed (2)

lib/sqlalchemy/engine/base.py

 
             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:

lib/sqlalchemy/engine/default.py

         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.