[sqlalchemy] Re: len() of declarative backref

2011-12-18 Thread Jad Kik
Thank you Micheal ! It is the ~any() I was searching for. I should have found it in the docs myself, but they are so long I think I'll need a month to read them all :). The EXISTS is new to me. I said I'm a newbie, so ... :D For the len thing, I thought it would be more intuitive to do it like

Re: [sqlalchemy] Re: Strange behavior from Association object in many to many relationships

2011-12-18 Thread Michael Bayer
The core of the issue is that this: ub.book = book places UserBook into the Session via cascades. Usually this is convenient. However, it can be tailored to behave more accurately. WIthout any changes, for this use case I usually just construct association objects with all their state at

[sqlalchemy] How to work with python3.2 and mysql?

2011-12-18 Thread Florent Angebault
Hello. I tried many different configurations to connect to mysql5 server using python3.2 and sqlalchemy 0.7.4 but couldn't have success. I always end with an error due to the fact that some string data is of type 'bytes' instead of 'str'. Below are 2 test cases that both fail. The first one

Re: [sqlalchemy] How to work with python3.2 and mysql?

2011-12-18 Thread Michael Bayer
On Dec 18, 2011, at 6:29 AM, Florent Angebault wrote: Hello. I tried many different configurations to connect to mysql5 server using python3.2 and sqlalchemy 0.7.4 but couldn't have success. I always end with an error due to the fact that some string data is of type 'bytes' instead of

[sqlalchemy] Error on insert, warning from mysqldb

2011-12-18 Thread Lee Hinde
I'm brand new to sqlalchemy, and reasonably new to python. I'm working on migrating data from one MySQL database to another at Amazon's RDS. I have one TinyInt field,'Error' and if the value in that field is 1, then I get a warning from MySQLdb :

[sqlalchemy] RowProxy to plist?

2011-12-18 Thread Grashopa
I want to return a plist to my iPhone app - what is the best way to go from a RowProxy to a simple list of lists which I could then convert to a plist. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

Re: [sqlalchemy] Error on insert, warning from mysqldb

2011-12-18 Thread Michael Bayer
On Dec 18, 2011, at 1:25 PM, Lee Hinde wrote: I'm brand new to sqlalchemy, and reasonably new to python. I'm working on migrating data from one MySQL database to another at Amazon's RDS. I have one TinyInt field,'Error' and if the value in that field is 1, then I get a warning from

[sqlalchemy] Copying Data base from disk to memory, working from memory and backing up to disk

2011-12-18 Thread rivka
For the sake of speed - I would like to work with my database in memory (disk access is a killer). So - I would like to load my database from disk to memory - without going through a query.all() and then - while working from memory - occasionally commit to the disk (or - when executing a commit -

Re: [sqlalchemy] Copying Data base from disk to memory, working from memory and backing up to disk

2011-12-18 Thread Michael Bayer
On Dec 18, 2011, at 1:56 PM, rivka wrote: For the sake of speed - I would like to work with my database in memory (disk access is a killer). So - I would like to load my database from disk to memory - without going through a query.all() and then - while working from memory - occasionally

Re: [sqlalchemy] Error on insert, warning from mysqldb

2011-12-18 Thread Lee Hinde
Thanks, Michael. I found it the one place I hadn't looked 12 times. :-) On Dec 18, 2011, at 10:51 AM, Michael Bayer wrote: On Dec 18, 2011, at 1:25 PM, Lee Hinde wrote: I'm brand new to sqlalchemy, and reasonably new to python. I'm working on migrating data from one MySQL database to

[sqlalchemy] Re: RowProxy to plist?

2011-12-18 Thread Grashopa
On Dec 18, 1:29 pm, Grashopa markree...@gmail.com wrote: I want to return a plist to my iPhone app - what is the best way to go from a RowProxy to a simple list of lists which I could then convert to a plist. Here is the following code which works. Using the RowProxy didn't work as an argument

[sqlalchemy] Re: How long should it take to load a data base into memory?

2011-12-18 Thread rivka
So - actually investigated it thoroughly - and here are the results: My database size on disk is 362MB and includes the main table and multiple one to many associated tables. I am querying the main table (which has little info in itself - mainly id, an integer value and a string value (mostly

Re: [sqlalchemy] Re: How long should it take to load a data base into memory?

2011-12-18 Thread Michael Bayer
On Dec 18, 2011, at 5:53 PM, rivka wrote: So - actually investigated it thoroughly - and here are the results: My database size on disk is 362MB and includes the main table and multiple one to many associated tables. I am querying the main table (which has little info in itself - mainly

Re: [sqlalchemy] How to refer to a live SA transaction from subsequent requests

2011-12-18 Thread Andronikos Nedos
On Saturday, 17 December 2011 19:57:10 UTC, Michael Bayer wrote: On Dec 17, 2011, at 2:24 PM, Andronikos Nedos wrote: So, if I understand correctly, I need to maintain the Connection object between requests and on the 2nd request bind a session to the existing Connection object and

[sqlalchemy] Multiple sessions and data conflicts.

2011-12-18 Thread Jackson, Cameron
Here is a simplified version of my scenario: My application has two session objects. One is being used for editing certain data, and the other is reading this data, doing some calculations, and displaying the results. I've set up a callback kind of system so that whenever the first session does

Re: [sqlalchemy] Multiple sessions and data conflicts.

2011-12-18 Thread Michael Bayer
On Dec 18, 2011, at 8:25 PM, Jackson, Cameron wrote: Here is a simplified version of my scenario: My application has two session objects. One is being used for editing certain data, and the other is reading this data, doing some calculations, and displaying the results. I've set up a

Re: [sqlalchemy] Re: How long should it take to load a data base into memory?

2011-12-18 Thread Krishnakant Mane
May be I am wrong, But I guess you have not used stored procedures? If speed and performance is important along with scalability, then forget database independence and use stored procedurs. I have built a small function called execProc() which I can send you off the list. It just makes use of

RE: [sqlalchemy] Multiple sessions and data conflicts.

2011-12-18 Thread Jackson, Cameron
OK, I think I understand. Just to make sure, how about this example: from SomeModule import Session, Foo session1 = Session() session2 = Session() data1 = session1.query(Foo).all() data2 = session2.query(Foo).all() data1[0].bar = 'Baz' data1.append(Foo)