bdarnell / torndb

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

Fallback to pymysql #40

Closed tebeka closed 8 years ago

tebeka commented 8 years ago

This allows torndb to fallback to pymysql which is pure Python and does not require compilation or mysql headers.

bdarnell commented 8 years ago

Thanks! But be aware that this package is not maintained any more and I don't plan to make more changes to it.

tebeka commented 8 years ago

Thanks! I know but I have some legacy code I'd like to support.

Any chance there will be a new release to pypi?

bdarnell commented 7 years ago

Does this work for you? When I try to import torndb with pymysql instead of MySQLdb, I get

python -c 'import torndb'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/torndb/lib/python3.5/site-packages/torndb.py", line 266, in <module>
    CONVERSIONS[field_type] = [(FLAG.BINARY, str)] + CONVERSIONS[field_type]
TypeError: can only concatenate list (not "function") to list
tebeka commented 7 years ago

I see what you mean. It's been a while since I've worked on that project and I don't have access to the actuall working patch.

I've added a check to do that code only on MySQLdb and not on pymysql