bdarnell / torndb

A lightweight wrapper around MySQLdb. Originally part of the Tornado framework.
582 stars 202 forks source link

max_idle_time parsed as float #11

Closed stevepeak closed 11 years ago

stevepeak commented 11 years ago

I frequently construct via:

torndb.Connection(**re.search("mysql://(?P<user>\w+):(?P<password>\w*)@(?P<host>.*)/(?P<database>[\w\-]+)\?reconnect=true&max_idle_time=(?P<max_idle_time>\d+)",
    "mysq://user:pass@host/database?reconnect=true&max_idle_time=60").groupdict())

But max_idle_time gets parsed as a string, not a float. So adding the float(max_idle_time) will make this method possible.