Re: [sqlalchemy] finding table/column name of unique constraint failure

2013-05-21 Thread lars van Gemerden
Thanks, Michael On Mon, May 20, 2013 at 12:52 AM, Michael Bayer mike...@zzzcomputing.comwrote: On May 19, 2013, at 4:39 AM, lars van gemerden l...@rational-it.com wrote: Hi all, I generate webpages in which end-users can input data that is stored in a database via sqla.The datamodel

Re: [sqlalchemy] Working with stored procedures

2013-05-21 Thread Charlie Clark
Am 20.05.2013, 00:53 Uhr, schrieb Michael Bayer mike...@zzzcomputing.com: Yes, SQLA actually doesn't get into callproc() or any of that at all right now. Not that we can't someday, but it hasn't been a priority to build around that. (It is something I'm curious about, stored procedure

[sqlalchemy] Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-21 Thread Etienne Rouxel
Hello In my program, I was trying to guess why so many SQL queries were sent while some could have been avoided with the help of the identity map. So, I reduced my program to what is below and wrote 3 times the same query.get call and 3 SQL queries were sent to the database server. Why does

Re: [sqlalchemy] Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-21 Thread Charlie Clark
Am 21.05.2013, 17:31 Uhr, schrieb Etienne Rouxel rouxel.etie...@gmail.com: if __name__ == '__main__': engine = create_engine('postgresql://user@localhost:5432/mydatabase') Session = sessionmaker(bind=engine) session = Session() session.query(Descriptiontype).get(-2147483648)

Re: [sqlalchemy] Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-21 Thread Simon King
On Tue, May 21, 2013 at 4:31 PM, Etienne Rouxel rouxel.etie...@gmail.com wrote: Hello In my program, I was trying to guess why so many SQL queries were sent while some could have been avoided with the help of the identity map. So, I reduced my program to what is below and wrote 3 times the

[sqlalchemy] Re: Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-21 Thread Etienne Rouxel
@Charlie Clark: In the documentation (http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#session-frequently-asked-questions see Is the Session a cache ?), it is mentioned that it does not necessarily performs a query. @Simon King: I guess you're the King indeed, I tried: 1. to assign the

Re: [sqlalchemy] Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-21 Thread Michael Bayer
if I might make a suggestion - why are negative numbers being used as surrogate primary key values ? I don't believe there's any restriction in SQLAlchemy as to this, but it seems a bit suspect. On May 21, 2013, at 2:13 PM, Etienne Rouxel rouxel.etie...@gmail.com wrote: @Charlie Clark: In

[sqlalchemy] Re: Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-21 Thread Etienne Rouxel
@Michael Bayer: The database type used is integer with a range from -2147483648 to +2147483647 according to the documentation (http://www.postgresql.org/docs/8.4/interactive/datatype-numeric.html). I just started at the beginning of the range, that is why I have negative numbers. I performed

[sqlalchemy] SA 0.8.0: Invalid argument(s) 'label_length'

2013-05-21 Thread Anthony Kong
Hi, all, I have recently upgraded to use SA 0.8.0. Now when I run this statement, db = create_engine(sybase://, creator=self.buildConnection, echo=echo, label_length=30) it throws a TypeError exception: TypeError: Invalid argument(s) 'label_length' sent to create_engine(), using