I am using GAE with the Google Cloud SQL module "rdbms".  According to the 
documentation<https://developers.google.com/appengine/docs/python/cloud-sql/developers-guide>,
 
rdbms uses DB-API 2.0 <http://www.python.org/dev/peps/pep-0249/>.  What 
I've been trying to do is take advantage of the cursor.description 
attribute, which is a sequence of 7 item sequences (name, type_code, 
 display_size, internal_size,  precision,  scale, null_ok).  "type_code" is 
what I'm trying to get at , because I need to pass the data to Google 
Visualizations, which require types to be declared for each column.

Here's the problem:

"type_code" is returned as an integer.  Different integers represent 
different types.  I searched madly on the internet for mappings for these 
codes, and found them for 
MySQLdb<http://mysql-python.sourceforge.net/MySQLdb-1.2.2/public/MySQLdb.constants.FIELD_TYPE-module.html>.
 
 The problem is that the ones returned from the Google Cloud SQL rdbms 
module (for Google App Engine) returns different codes!  An integer gets a 
different code on my local machine than an integer returned from Google 
Cloud SQL in GAE.

So my questions:
1. Does anyone know where I can get a mapping for the type_codes returned 
from the rdbms module to GAE?  Or am I going to have to manually test each 
type in the database?
2. Are there any constants for FIELD_TYPE that I can use with rdbms?  MySQLdb 
defines these constants in human-readable 
form<http://mysql-python.sourceforge.net/MySQLdb-1.2.2/public/MySQLdb.constants.FIELD_TYPE-module.html>,
 
so it would be great if rdbms had the same constant names, so that I 
wouldn't have to worry about coding for two type mappings.

Can anyone help?  Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/98ud1EvIe3MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to