2008/9/22 Alex Marandon <[EMAIL PROTECTED]>:
> Also, I wonder if changing the server configuration is an ideal
> solution, as it makes the app relying on specific settings to be
> deployed. Would it make sense to provide a way to specify the type of
> table generated by associable? Maybe within an extra table options
> parameter? If so, I'd be happy to try and make a little patch.

I've found a better way to do this: configuring the connections used by
SQLAlchemy rather than the whole server.

MySQLdb's connect() function takes an init_command argument that can
contain SQL executed upon connection. As for SQLAlchemy's
create_engine() function, it takes a connect_args argument which is a
dictionary of arguments to pass to MySQLdb's connect() function.
Therefore I can do something like:

engine = create_engine(db_url, connect_args={'init_command':'SET
storage_engine=InnoDB'})

Now tables created by associable are InnoDB and I don't need to change
MySQL configuration.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to