Has anyone got a connection pool working with Django, SQLAlchemy and MySQL?
I used this tutorial ( http://node.to/wordpress/2008/09/30/another-database-connection-pool-solution-for-django-mysql/ ), which worked fine, but the problem I am facing , - this is when I return the time field it is converted to timedelta, since the conversions specific to Django are not used.
Conversion code from django / db / backends / mysql / base.py
django_conversions = conversions.copy() django_conversions.update({ FIELD_TYPE.TIME: util.typecast_time, FIELD_TYPE.DECIMAL: util.typecast_decimal, FIELD_TYPE.NEWDECIMAL: util.typecast_decimal,
})
Connection code from the article:
if settings.DATABASE_HOST.startswith('/'): self.connection = Database.connect(port=kwargs['port'], unix_socket=kwargs['unix_socket'], user=kwargs['user'], db=kwargs['db'], passwd=kwargs['passwd'], use_unicode=kwargs['use_unicode'], charset='utf8') else: self.connection = Database.connect(host=kwargs['host'], port=kwargs['port'], user=kwargs['user'], db=kwargs['db'], passwd=kwargs['passwd'], use_unicode=kwargs['use_unicode'], charset='utf8')
django mysql connection-pooling sqlalchemy
Colin humber
source share