Closed GoogleCodeExporter closed 9 years ago
Could this be as simple as adding `decimal.Decimal: jdbc_type.DECIMAL` to
_PYTHON_TYPE_TO_JDBC_TYPE?
https://code.google.com/p/googleappengine/source/browse/trunk/python/google/stor
age/speckle/python/api/rdbms.py#141
Original comment by techniq35
on 12 Mar 2013 at 6:11
I hope to hear a response soon as this is a critical issue for us and are
investigating other hosting options at this point if a fix is not found soon.
Original comment by techniq35
on 12 Mar 2013 at 6:28
We're working on a fix for this, but for now, you can try including the
following monkeypatch somewhere in your application's bootstrapping code for
immediate support:
import decimal
from google.storage.speckle.proto import jdbc_type
from google.storage.speckle.python.api import rdbms as api_rdbms
from google.storage.speckle.python.api import converters
api_rdbms._PYTHON_TYPE_TO_JDBC_TYPE[decimal.Decimal] = jdbc_type.DECIMAL
converters.conversions[decimal.Decimal] = converters.Any2Str
converters.conversions[jdbc_type.DECIMAL] = decimal.Decimal
Then, your code should function with decimal support:
from google.appengine.api import rdbms
conn = rdbms.connect('<instance name>')
cursor = conn.cursor()
cursor.execute('SELECT %s', decimal.Decimal('1.23'))
print cursor.fetchone()
(u'1.23',)
Original comment by mmcdon...@google.com
on 13 Mar 2013 at 12:12
Thank you. My initial tests look positive. I will test more tomorrow and let
you know my findings.
Original comment by techniq35
on 13 Mar 2013 at 12:44
The monkeypatch is working well. It appears the rdbms is wrapping more thrown
errors than yesterday as I've had to update the SQLAlchemy driver to handle
these (could just be coincidence).
Original comment by techniq35
on 13 Mar 2013 at 4:58
These issues with the deprecated drivers will not be fixed now that Cloud SQL
works against the regular MySQL drivers and using the regular drivers is the
only supported solution.
See https://developers.google.com/cloud-sql/docs/native-mysql-gae
Thank you.
Original comment by rclev...@google.com
on 12 Feb 2014 at 8:15
Original issue reported on code.google.com by
techniq35
on 10 Mar 2013 at 4:56