[sqlalchemy] Advice for Method to consistently import XML into SQLAlchemy

2014-05-14 Thread Sayth Renshaw
Hi Looking for some guidance and advice on using xml as an update source for my to be data web project. If I am consistently going to be updating data into the database from XML files what is a good method? Should I be creating a Sax parser as in this example

Re: [sqlalchemy] Create database with sqlalchemy 0.8.0 and postgres

2014-05-14 Thread Tony Locke
I've had a look at this and submitted a patch that should make autocommit work for the pg8000 Sqlalchemy dialect in the same way as it does for the psycopg2 dialect https://github.com/zzzeek/sqlalchemy/pull/88. On Friday, 9 May 2014 17:50:43 UTC+1, Tony Locke wrote: Hi, the pg8000 driver has

Re: [sqlalchemy] Concurrent raw sql execution in a multi-threaded application: Connection is busy with results for another hstmt error

2014-05-14 Thread Sylvester Steele
Correct, that is what I did. Except, I do a conn.close() at the end rather than a del. On Tue, May 13, 2014 at 4:10 PM, Michael Bayer mike...@zzzcomputing.comwrote: On May 13, 2014, at 2:23 PM, Sylvester Steele sylvesterste...@gmail.com wrote: ODBC connection pooling setting did not

Re: [sqlalchemy] How do you limit/specify the columns that are loaded via a relationship()?

2014-05-14 Thread Seth
Thanks Mike, But...is there no way to set this behavior directly on the relationship()? The whole point there is to be lazy ;) Seth On Saturday, May 10, 2014 7:59:33 PM UTC-7, Michael Bayer wrote: session.query(Parent).options(defaultload(“children”).load_only(“cheap_column)) or really

Re: [sqlalchemy] How do you limit/specify the columns that are loaded via a relationship()?

2014-05-14 Thread Michael Bayer
there are deferred() columns that you can set on a mapper but there's not a mechanism right now to set deferred target attributes when the object is loaded only from a specific relationship without the specific call within the query(). So unless you maybe ran those options into every Query

[sqlalchemy] common table expressions for INSERT, UPDATE, and DELETE

2014-05-14 Thread Hunter Blanks
Hi, Although SQLAlchemy supports PostgreSQL's common table expressions (i.e. WITH statements*) for SELECT, it does not yet seem to support them for INSERT, UPDATE, or DELETE. (1) Can anyone confirm that this is the case? Lest it help, I've attached test cases for UPDATE and DELETE below.

Re: [sqlalchemy] How do you limit/specify the columns that are loaded via a relationship()?

2014-05-14 Thread Seth
Ok, thanks so much for your help. On Wednesday, May 14, 2014 2:35:27 PM UTC-7, Michael Bayer wrote: there are deferred() columns that you can set on a mapper but there’s not a mechanism right now to set deferred target attributes when the object is loaded only from a specific

[sqlalchemy] Do passive deletes apply to many to many relationships?

2014-05-14 Thread Randy Syring
I am trying to get SQLAlchemy to let my database's foreign keys on delete cascade do the cleanup on the association table between two objects. I have setup the cascade and passive_delete options on the relationship as seems appropriate from the docs. However, when a related object is loaded