Cursors returning raw data

Registered by Geert JM Vanderkelen

We need a Cursor-class which would return result sets not converted to Python types. This would be more performant and might be handy if one does the conversion in the application.

Blueprint information

Status:
Not started
Approver:
Geert JM Vanderkelen
Priority:
Undefined
Drafter:
Geert JM Vanderkelen
Direction:
Needs approval
Assignee:
Geert JM Vanderkelen
Definition:
Drafting
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

We can set the raw parameter when setting up the connection

  >>> import mysql.connector as db
  >>> cnx = db.connect(user='root',raw=True)
  >>> cur = cnx.cursor()
  >>> cur.execute("SELECT NOW()")
  -1
  >>> print cur.fetchall()
  [('2010-05-23 14:59:19',)]

But we should also be able to set the raw per cursor. Continueing from
the example above:

  >>> cur2 = cnx.cursor(raw=False)
  >>> cur2.execute("SELECT NOW()")
  >>> print cur2.fetchall()
  [(datetime.datetime(2010, 5, 23, 14, 59, 25),)]

It should be available for both buffered and non-buffered cursors.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.