Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-11-18 Thread Nick Retallack
Ok, I'm trying that now. The result is that it tries to delete all of the tables out of prototype and create them all again with no specific schema set. Creating them without a specific schema is what I want, but this patch is useless if it just deletes and creates everything. I think I need

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-11-18 Thread Nick Retallack
Here is the finished product: https://gist.github.com/nickretallack/bb8ca0e37829b4722dd1 It still requires me to edit the schemas out of the migrations after the fact, but at least the interesting work is all handled by alembic. -- You received this message because you are subscribed to the

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-11-17 Thread Nick Retallack
On Monday, November 17, 2014 6:55:49 PM UTC-8, Michael Bayer wrote: for what specifically? Autogenerate will work with whatever data you give it. Send in a target_metadata with what you want to view on the Python side and tailor an include_object() function if you need in order to

[sqlalchemy] Re: Am I really doing this right?

2010-06-03 Thread Nick Retallack
On Jun 3, 8:53 am, Michael Bayer mike...@zzzcomputing.com wrote: Is it a common practice to pass the current session into the constructor of an ORM model?   no.   The session consumes your objects, not the other way around.  An object can always get its current session via

[sqlalchemy] Re: Am I really doing this right?

2010-06-03 Thread Nick Retallack
Pretend I bound that metadata and session to an engine at some point... On Jun 3, 12:59 pm, Nick Retallack nickretall...@gmail.com wrote: On Jun 3, 8:53 am, Michael Bayer mike...@zzzcomputing.com wrote: Is it a common practice to pass the current session into the constructor of an ORM

[sqlalchemy] Am I really doing this right?

2010-06-02 Thread Nick Retallack
I have a lot of questions, so bear with me. I've been having some doubts about whether I'm really using sqlalchemy in a good way. -- Is there any use case for having more than one session active in the same thread? Or does everyone use threadlocal sessions? If you bind different tables to

[sqlalchemy] Re: Output/Update Current Schema?

2009-12-25 Thread Nick Retallack
Thanks for all the info. I feel a lot better about using this orm now =] On Dec 24, 7:50 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 24, 2009, at 3:44 PM, Nick Retallack wrote: I've looked at sqlalchemy-migrate, but I can't figure out how it works.  Can you give me an example

[sqlalchemy] Re: Output/Update Current Schema?

2009-12-24 Thread Nick Retallack
mike...@zzzcomputing.com wrote: On Dec 21, 2009, at 9:05 PM, Nick Retallack wrote: Say you've created some models in SQLAlchemy, and run create_all() to get them into the database.  Later on, you changed some of their definitions, and you need to update the database schema to correspond