Commits

Owen Nelson committed 986193f

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

Comments (0)

Files changed (1)

cloudstudio/driver.py

+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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.