1. Owen Nelson
  2. cloud-studio

Commits

Owen Nelson  committed 986193f

adding a namedtuple for cursor.description, though we probably only ever want the first idx (which is column name)

  • Participants
  • Parent commits 466cc0b
  • Branches master

Comments (0)

Files changed (1)

File cloudstudio/driver.py

View file
  • Ignore whitespace
+from collections import namedtuple
 from PySide import QtSql
 from google.storage.speckle.python.api import rdbms_googleapi as dbi
 
 
+# When a cursor has executed a statement, it will have a description
+# property with a list of values describing the data it contains.
+ResultDescription = namedtuple(
+    'ResultDescription',
+    'name type_code display_size internal_size precision scale null_ok')
+
+
 class CloudSqlDriver(QtSql.QSqlDriver):
     """Implementation of the Driver ABC. See:
     http://srinikom.github.com/pyside-docs/PySide/QtSql/QSqlDriver.html#PySide.QtSql.QSqlDriver