[sqlalchemy] Re: Relationship operator vs join and filter

2011-03-22 Thread Wouter Overmeire
On Mar 21, 11:42 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 21, 2011, at 7:21 AM, Wouter Overmeire wrote: New to sql and sqlalchemy. Using an in memory sqlite database. Trying to do some queries based on the examples in the sqlalchemy documentation. I have

[sqlalchemy] association_proxy introspection

2011-03-22 Thread sandro dentella
Hi, i just discovered association_proxy and like it very much. It definetely helps in some situations. I already have a library that setup gui instrospecting the mapper, to allow editing and filtering of records. the only way I found to get the association_proxy of a class is checking its

[sqlalchemy] scoped_session class level variables

2011-03-22 Thread Serge Koval
Hello, According to docs, I can use class level methods and variables with the ScopedSession: Since theSession() http://www.sqlalchemy.org/docs/orm/session.html#sqlalchemy.orm.session.Sessionconstructor now returns the sameSession

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Michael Bayer
On Mar 22, 2011, at 12:44 PM, jaypipes wrote: Hello all, I've decided to post here because bug reports and the mailing list for sqlalchemy-migrate don't seem to be monitored any more... I don't see a post regarding this issue at http://groups.google.com/group/migrate-users , have you

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Jay Pipes
On Tue, Mar 22, 2011 at 1:35 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 22, 2011, at 12:44 PM, jaypipes wrote: Hello all, I've decided to post here because bug reports and the mailing list for sqlalchemy-migrate don't seem to be monitored any more... I don't see a post

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Michael Bayer
On Mar 22, 2011, at 2:32 PM, Jay Pipes wrote: I don't think it's a migrate problem. I think it's a SQLAlchemy problem. In the case when SQLite is the engine, a Table() object constructed with a new MetaData() before and after a SQL script is executed against the database will not show the

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Jay Pipes
On Tue, Mar 22, 2011 at 3:12 PM, Michael Bayer mike...@zzzcomputing.com wrote: if you say this: Table('sometable', MetaData(), autoload=True, autoload_with=some_engine) its not looking for changes, its reflecting the entire form of that table brand new, each time. This because the

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Michael Bayer
On Mar 22, 2011, at 3:56 PM, Jay Pipes wrote: On Tue, Mar 22, 2011 at 3:12 PM, Michael Bayer mike...@zzzcomputing.com wrote: if you say this: Table('sometable', MetaData(), autoload=True, autoload_with=some_engine) its not looking for changes, its reflecting the entire form of that

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Jay Pipes
On Tue, Mar 22, 2011 at 3:58 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 22, 2011, at 3:56 PM, Jay Pipes wrote: On Tue, Mar 22, 2011 at 3:12 PM, Michael Bayer mike...@zzzcomputing.com wrote: if you say this: Table('sometable', MetaData(), autoload=True,

[sqlalchemy] Appending to a collection duplicates the element

2011-03-22 Thread Debilski
Hi, I’m having a problem with the collection append method in a many-to- many relationship with association object. Basically, I’d like to connect classes of type Entity through a Context object (which holds a description of the connection type). Programmatically, it should go like experiment =

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Jay Pipes
On Tue, Mar 22, 2011 at 4:27 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 22, 2011, at 4:09 PM, Jay Pipes wrote: Running with sqlite3 executes a brand new process with all new state, whereas using engine uses a SQLite connection that has remained established throughout the

Re: [sqlalchemy] Appending to a collection duplicates the element

2011-03-22 Thread Michael Bayer
On Mar 22, 2011, at 6:03 PM, Debilski wrote: Hi, I’m having a problem with the collection append method in a many-to- many relationship with association object. Basically, I’d like to connect classes of type Entity through a Context object (which holds a description of the connection type).

Re: [sqlalchemy] MetaData not refreshed properly when using SQLite

2011-03-22 Thread Michael Bayer
On Mar 22, 2011, at 6:46 PM, Jay Pipes wrote: On Tue, Mar 22, 2011 at 4:27 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 22, 2011, at 4:09 PM, Jay Pipes wrote: Running with sqlite3 executes a brand new process with all new state, whereas using engine uses a SQLite connection

[sqlalchemy] Discarded overflow connection object object does not automatically close DB socket connection in Jython

2011-03-22 Thread Jaimy Azle
Dear All, I am using SQLAlchemy with Jython, I found there is a different SQLAlchemy behaviour between CPython and Jython. In Jython, discarded overflow connection object does not automatically close the actual database socket connection during gc, anybody could confirm this? my temporary,

[sqlalchemy] sqlalchemy with pyodbc - Error: 'pyodbc.Connection' object is not callable

2011-03-22 Thread Thang Nguyen
Hi, I tried to use sqlalchemy (linux) to connect to MS SQL server (Windows) via ODBC (pyodbc). I got the errors below, just wonder if something was not done correctly. Please shed a light, and thanks in advance. TPN import pyodbc import sqlalchemy from sqlalchemy import * pycon =

Re: [sqlalchemy] Discarded overflow connection object object does not automatically close DB socket connection in Jython

2011-03-22 Thread Michael Bayer
uh yeah you totally nailed that one, QueuePool and SingletonThreadPool had similar issues. I think in Jython those connections would eventually be closed when asynchronous gc collects them, but we definitely don't ever want to rely on gc to close connections we're discarding. This issue

Re: [sqlalchemy] sqlalchemy with pyodbc - Error: 'pyodbc.Connection' object is not callable

2011-03-22 Thread Michael Bayer
On Mar 22, 2011, at 10:12 PM, Thang Nguyen wrote: Hi, I tried to use sqlalchemy (linux) to connect to MS SQL server (Windows) via ODBC (pyodbc). I got the errors below, just wonder if something was not done correctly. Please shed a light, and thanks in advance. TPN import pyodbc