[sqlalchemy] [alembic] import the own model into myproject/alembic/env.py

2015-08-16 Thread c.buhtz
I want to use `alembic revision --autogenerate` with my own model classes. Because of that I need to import them in `myproject/alembic/env.py` as [described in the docs][1]. But this doesn't work even if I tried a lot of variations. I am not sure in which context (don't know if this is the

[sqlalchemy] thread-safety of Session, Engine, and Connections

2015-08-16 Thread Jinghui Niu
For clarity I made a table below in my notes out of reading the documentation and generalize the points: Engine: no worries, Engine object is always thread safe. Session: Session objects are tricky, they can be quite dangerous to use in a multi-threading context if one is not careful. Forget

Re: [sqlalchemy] use sqlalchemy core to construct sql on given sql execute api

2015-08-16 Thread Mike Bayer
On 8/15/15 8:07 PM, dbbbit wrote: we have to execute our sql in limited form in our company, like `sqlstore.execute('select id from foos where is_foo = %s and create_time%', (1, datetime.now())`, which sqlstore.execute is defined like: defexecute(self,sql,args=None,executemany=False): the

Re: [sqlalchemy] [alembic] import the own model into myproject/alembic/env.py

2015-08-16 Thread Mike Bayer
On 8/16/15 8:57 AM, c.bu...@posteo.jp wrote: I want to use `alembic revision --autogenerate` with my own model classes. Because of that I need to import them in `myproject/alembic/env.py` as [described in the docs][1]. But this doesn't work even if I tried a lot of variations. I am not sure