[sqlalchemy] Re: Deleting multiple objects

2009-08-20 Thread thatsanicehatyouhave
On 19 Aug 2009, at 18:32, Mike Conley wrote: The delete method of query supports bulk deletes. In your case it might be something like session.query(Users).filter(User.officeid==office.id).delete() Any query can be used; there are probably more elegant ways to take advantage of the

[sqlalchemy] index in SA

2009-08-20 Thread rajasekhar911
Hi Is it possible to add index to my table using sqlalchemy? Or should i do it directly on the database? Thanks.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Database Reconnect Logic

2009-08-20 Thread ACB
The system I work on connects to a number of different databases with varying quality of network connectivity. As a result, I’ve modified the application to run most transactions through a reconnect loop. Initially the loop just created new connections when it retried a transaction, but I’d

[sqlalchemy] Re: index in SA

2009-08-20 Thread Gregg Lind
If you need to use some SQL is that is not supported by UniqueConstraint, PrimaryKeyConstraint and friends, you can use the DDL statement: # DDL to only run on postgres, incorporating declarative style from sqlalchemy.schema import DDL DDL('''ALTER TABLE orgdata ADD

[sqlalchemy] Multiple Mappers for the same class in different databases

2009-08-20 Thread Johannes Knopp
Hi *, I am currently working on a Wikipedia API which means that we have a database for each language we want to use. The structure of each database is identical, they only differ in their language. The only place where this information is stored is in the name of the database. When starting

[sqlalchemy] Re: Vertical partitioning, mappers and foreign keys

2009-08-20 Thread Michael Bayer
not sure what the exact setup is here, but if you're trying to load from A-B across multiple tables that cross from one database to another, you'll have to roll that by hand i.e. using a plain Python method on your parent class; its not possible to do a join across two different databases

[sqlalchemy] Re: Deleting multiple objects

2009-08-20 Thread Michael Bayer
On Aug 20, 2009, at 12:30 PM, thatsanicehatyouh...@mac.com wrote: On 19 Aug 2009, at 18:32, Mike Conley wrote: The delete method of query supports bulk deletes. In your case it might be something like session.query(Users).filter(User.officeid==office.id).delete() Any query can be

[sqlalchemy] Re: Database Reconnect Logic

2009-08-20 Thread Michael Bayer
seems like you are calling invalidate() or close() before calling invalidate() again, since both del __connection the first time. try calling connection.closed or connection.invalidated first. On Aug 20, 2009, at 10:41 AM, ACB wrote: The system I work on connects to a number of

[sqlalchemy] Re: index in SA

2009-08-20 Thread Michael Bayer
this is usually accomplished using Index(). see the metadata docs for details. On Aug 20, 2009, at 12:35 PM, rajasekhar911 wrote: Hi Is it possible to add index to my table using sqlalchemy? Or should i do it directly on the database? Thanks..

[sqlalchemy] Re: Multiple Mappers for the same class in different databases

2009-08-20 Thread Michael Bayer
On Aug 20, 2009, at 3:59 PM, Johannes Knopp wrote: Hi *, I am currently working on a Wikipedia API which means that we have a database for each language we want to use. The structure of each database is identical, they only differ in their language. The only place where this information

[sqlalchemy] im still on vacation

2009-08-20 Thread Michael Bayer
just had some time to answer stuff today, that's all. will be back in full gear sunday. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] table creation oddity

2009-08-20 Thread Faheem Mitha
Hi, The following script is then followed by its output, and finally by the table output. I don't get what is going on here. Yes, I should commit the session, and the table is empty as expected, but why does the id keep incrementing on successive runs, and where is this table living, if not