Closed scwood closed 8 years ago
So I have a client deadline that I had to meet and "fixed it" by replacing a block of code in orator/connectors/mysql_connector.py
try:
import MySQLdb as mysql
from MySQLdb.cursors import DictCursor as cursor_class
keys_fix = {
'password': 'passwd',
'database': 'db'
}
except ImportError:
try:
import pymysql as mysql
from pymysql.cursors import DictCursor as cursor_class
keys_fix = {}
except ImportError:
mysql = None
with:
try:
import pymysql as mysql
from pymysql.cursors import DictCursor as cursor_class
keys_fix = {}
except ImportError:
mysql = None
I'm assuming this problem stems from an old version of MySQLdb on my end or something, unfortunately I can't monkey with the version of that package and a more robust solution like docker isn't available.
Orator prioritizes MySQLDB over PyMySQL and, for now, there is no way to tell it to use one over the other.
Orator assumes that you are using only one MySQL package in your project.
However, it seems that you have an old version of MySQLDB (propably the mysql-python
package that has not been updated in years). Orator only supports the mysqlclient
package.
That makes sense. I'll go ahead and close this.
I know there's a similar issue open however mine seems a little bit different. This is happening on my production server but not on local.
The driver I am using (I think) is PyMySQL, I say I think because in that stack trace it's inside the MySQLdb package. Is there a way I can force Orator to use PyMySQL? Or perhaps I don't understand the stack trace. This is happening when I'm calling .all() on one of my models.
The model code:
Here's the SQL dump of the table if that's useful