RE: [sqlalchemy] Storing Nested Lists

2010-04-26 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of greg Sent: 25 April 2010 22:59 To: sqlalchemy Subject: [sqlalchemy] Storing Nested Lists Hi All, I'm new to sqlalchemy. I've been reading the documentation and group

Re: [sqlalchemy] Mapping dictionaries with string keys and record values

2010-04-26 Thread Torsten Landschoff
Hi Michael. On Sun, 2010-04-25 at 22:32 -0400, Michael Bayer wrote: You should be able to roll this yourself as a custom dictlike collection class . That's what I did :-) I wrote mostly to share my code and to suggest that this should be available out of the box. sorry, it seems

[sqlalchemy] Re: Storing Nested Lists

2010-04-26 Thread greg
Excellent. Thanks very much. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-26 Thread Chris Withers
Michael Bayer wrote: Any serious ideas or should I just go sulk in the corner? you have to use IN, and you have to generate the SQL every time based on the number of values you'd like to put into the IN. Does SA have any helper code anywhere for this? Chris -- You received this message

[sqlalchemy] correct way to handle 'MySQL server has gone away'?

2010-04-26 Thread Chris Withers
Chris Withers wrote: raise exc.InvalidRequestError(Can't reconnect until invalid transaction is rolled back) sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back Asking here as it sounds like it might be related. It occurred transiently, though, and

[sqlalchemy] Database locking

2010-04-26 Thread gazza
Hello, I am using multiple servers to access a sqlite db via sqlachemy. I am using the latest SQLAlchemy and pysqlite-2.6.0. I get permenant locking and it causes mayhem. I did rebuild sqlite to make it --enable-threadsafe. Whats the approach to handle this problem? Thanks, garyc -- You

Re: [sqlalchemy] Mapping dictionaries with string keys and record values

2010-04-26 Thread Michael Bayer
Torsten Landschoff wrote: Thanks for your reply and the remarks! Do you plan to extend attribute_mapped_collection to update the key like in my example? here's some things to note on that: 1. I'm not sure why it wasn't that way already, and I'd want to hear from Jason Kirtland, its author, on

Re: [sqlalchemy] correct way to handle 'MySQL server has gone away'?

2010-04-26 Thread Michael Bayer
Chris Withers wrote: Chris Withers wrote: raise exc.InvalidRequestError(Can't reconnect until invalid transaction is rolled back) sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back Asking here as it sounds like it might be related. It occurred

Re: [sqlalchemy] further restricting a query provided as raw sql

2010-04-26 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Any serious ideas or should I just go sulk in the corner? you have to use IN, and you have to generate the SQL every time based on the number of values you'd like to put into the IN. Does SA have any helper code anywhere for this? we have the in_()

Re: [sqlalchemy] Database locking

2010-04-26 Thread Michael Bayer
gazza wrote: Hello, I am using multiple servers to access a sqlite db via sqlachemy. I am using the latest SQLAlchemy and pysqlite-2.6.0. I get permenant locking and it causes mayhem. I did rebuild sqlite to make it --enable-threadsafe. Whats the approach to handle this problem? one

[sqlalchemy] Re-using labels

2010-04-26 Thread Peter Waller
Let's say I write something like: fixed_column = cast(my_column.op(/)(2**32), Integer).label(fixed_column) print select([fixed_column]).where(fixed_column 100) I get: SELECT CAST(my_column / :my_columnn_1 AS INTEGER) AS fixed_column FROM table WHERE CAST(my_column / :my_column_1 AS INTEGER)

Re: [sqlalchemy] Mapping dictionaries with string keys and record values

2010-04-26 Thread jason kirtland
On Mon, Apr 26, 2010 at 8:24 AM, Michael Bayer mike...@zzzcomputing.com wrote: Torsten Landschoff wrote: Thanks for your reply and the remarks! Do you plan to extend attribute_mapped_collection to update the key like in my example? here's some things to note on that: 1. I'm not sure why it

Re: [sqlalchemy] Mapping dictionaries with string keys and record values

2010-04-26 Thread Torsten Landschoff
On Mon, 2010-04-26 at 11:24 -0400, Michael Bayer wrote: 2. I wonder if there's a way to make this happen more deeply than within setattr(). Like the collection internals would include an event to operate upon the target object that includes the other args from the collection decorator.

Re: [sqlalchemy] Mapping dictionaries with string keys and record values

2010-04-26 Thread Torsten Landschoff
On Mon, 2010-04-26 at 11:08 -0700, jason kirtland wrote: 1. I'm not sure why it wasn't that way already, and I'd want to hear from Jason Kirtland, its author, on if we are missing something or otherwise whats up. I have a vague notion that there was a reason for this, or maybe not.

[sqlalchemy] Re: Database locking

2010-04-26 Thread gazza
Thanks Michael. Not sure if this is the only thing I need to do. Why disable connection pooling? Thanks, Garyc On Apr 26, 10:32 am, Michael Bayer mike...@zzzcomputing.com wrote: gazza wrote: Hello, I am using multiple servers to access a sqlite db via sqlachemy. I am using the latest

Re: [sqlalchemy] Re: Database locking

2010-04-26 Thread Michael Bayer
gazza wrote: Thanks Michael. Not sure if this is the only thing I need to do. Why disable connection pooling? it means the app will release filehandles completely when a connection is released, and also that individual threads in your app will use distinct connections. The QueuePool

Re: [sqlalchemy] Re: Database locking

2010-04-26 Thread gary clark
Thanks Michael. I am going to do some more research on SQLAlchemy and how it handles locks and its interaction with sqlite. I will try and post my findings next week. Thanks, Garyc --- On Mon, 4/26/10, Michael Bayer mike...@zzzcomputing.com wrote: From: Michael Bayer mike...@zzzcomputing.com