How to pass arguments to create_engine in Pylons application?

700 views Asked by At

I'd like to customize database connection in Pylons application. I'm interested in changing these arguments:

  • pool_size
  • pool_recycle

In SqlAlchemy the arguments are passed to *create_engine* call, like here: http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html?highlight=pool_size#sqlalchemy.create_engine

How can I change those params in Pylons?

1

There are 1 answers

1
Tom Willis On BEST ANSWER

you should be able to do it right in your ini file, it's been a while since I did pylons but IIRC, assuming you said yes to the sqlalchemy question when you created the project, all items prefixed with "slqalchemy." are given as keywords to the engine_from_config method in sqlalchemy. see the config/environment.py file for more.

sqlalchemy.url=<your db connection info>
sqlalchemy.pool_size= ??
sqlalchemy.pool_recycle= ??