I’m using ORM in sqlalchemy. The actual situation is I’m also using MySQL database, and I want to set some table configuration that MySQL has to fit my project.(eg. mysql_engine='InnoDB', mysql_charset='utf8' and so on)
I know there’s an approach using the SQL Expression provided by SA. But i prefer to use ORM interface instead. Any ideas?
P.S: How to make the same effect using ‘class mytable’ form (using ORM instead of SQL Expression maker)
you can pass mysql options in your Table definition in sqlalchemy.
http://www.sqlalchemy.org/docs/dialects/mysql.html#storage-engines
edit://
if you use the declarative layer, you can use ‘table_args‘ :
http://www.sqlalchemy.org/docs/05/reference/ext/declarative.html#table-configuration