Re: [Sqlalchemy-users] database literature

2006-09-11 Thread Huy Do
Alexandre CONRAD wrote: > Hello, > > I thought this might be a good place to ask for literature about > database design and concepts. Someone has already pointed me to this book: > > http://www.amazon.com/Essence-Databases-Computing/dp/0137278276/sr=1-1/qid=1157964289/ref=sr_1_1/103-8283722-570065

Re: [Sqlalchemy-users] offset and limit in Query object

2006-08-23 Thread Huy Do
Thanks Michael, That is one nice mod. Exactly what I needed. Huy > dont forget selectresults: > > SelectResults(query, table.c.foo=='bar')[20:30] > > On Aug 24, 2006, at 12:16 AM, Huy Do wrote: > > >> Sorry, >> >> Nevermind me. I should just

Re: [Sqlalchemy-users] offset and limit in Query object

2006-08-23 Thread Huy Do
Sorry, Nevermind me. I should just use it like query.select(limit=10, offset=20) Regards, Huy > Hi, > > Is there a way to specify an offset/limit on a Query object ? > > It would be nice if Query could be built like in "Building Select Objects" > > Regards, > > Huy > > --

[Sqlalchemy-users] offset and limit in Query object

2006-08-23 Thread Huy Do
Hi, Is there a way to specify an offset/limit on a Query object ? It would be nice if Query could be built like in "Building Select Objects" Regards, Huy - Using Tomcat but need to do more? Need to support web services, se

[Sqlalchemy-users] session and transactions - help

2006-06-14 Thread Huy Do
Hi, I am getting the following error when using sessions and session transactions. sqlalchemy.exceptions.InvalidRequestError: This transaction is inactive My code looks like the following: session = create_session() def other_method(): global session b = OtherClass() session.save(b) s

[Sqlalchemy-users] how to access cursor object of last commit/flush

2006-05-17 Thread Huy Do
Hi, Does anyone know how to get to the database warning messages (for postgresql/pscyopg at least). The DBAPI seems to specify the "messages" attribute on connection/cursor but I can't seem to get to it. Thanks Huy --- Using Tomcat but ne

Re: [Sqlalchemy-users] reverse engineer?

2006-05-09 Thread Huy Do
Jonathan Ellis wrote: On 5/9/06, *Luís Bruno* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Huy Do wrote: > I always do a session.clear() after I do my stored procs/triggers. Which just reminded me of PostgreSQL notifications. Maybe watching for those

Re: [Sqlalchemy-users] reverse engineer?

2006-05-08 Thread Huy Do
Hi Gambit, You raise some interesting questions which I have much interest in. I'd like to add my opinion to try and get other opinions so maybe we can all learn something from someone. Hey Jonathan, and everyone else, On the subject of large-table databases and representing them in an ORM

[Sqlalchemy-users] [Fwd: localtimestamp func for postgresql]

2006-04-26 Thread Huy Do
Hi, Just noticed that postgresql (v8.0) uses localtimestamp rather then local_timestamp. I've patched my own ansisql.py to make it work for me, but was hoping someone could fix it on the trunk. Thanks Huy --- Using Tomcat but need to do

Re: [Sqlalchemy-users] Problem with SELECT ... FOR UPDATE;

2006-04-04 Thread Huy Do
Michael Bayer wrote: HD - yah, youre good, this is how it works right now. Will whatever changes you guys are talking about upset this use case ? I like the simplicity of this, and it has worked well for alot of the stuff I do. Thanks Huy

Re: [Sqlalchemy-users] optimistic concurrency WAS hibernate

2006-03-30 Thread Huy Do
Michael Bayer wrote: Jonathan Ellis wrote: I don't understand the objection -- #3 is the only one that works in the general case without inefficiency as in #1 or attaching extra metadata to user tables as in #2. (SimpleORM uses #3 exclusively. :) its a huge hit on the database to comp

Re: [Sqlalchemy-users] Re: hook for before_update

2006-02-16 Thread Huy Do
Michael Bayer wrote: On Feb 16, 2006, at 9:02 PM, Huy Do wrote: This would be great. Is there a way to have the default function called on an instance method of each object to be updated ? not sure what you mean ? like setter/getters on the object instance ? I'm not sure mysel

[Sqlalchemy-users] Re: hook for before_update

2006-02-16 Thread Huy Do
I just committed a change for this into SVN (changeset 936), patch version is attached. Thanks. I'll try and use this. this also raises the idea that maybe a flag on schema.DefaultGenerator which allows it to execute unconditionally on every insert and update might be handy, then youd j

[Sqlalchemy-users] PG2Time question

2006-02-16 Thread Huy Do
Hi, Just wondering why PG2Time extends types.Date instead of types.Time Thanks Huy --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searchin

Re: [Sqlalchemy-users] Log of generated sql ?

2006-02-01 Thread Huy Do
Robert Leftwich wrote: On Thu, 02 Feb 2006 17:54:07 +1100, "Huy Do" <[EMAIL PROTECTED]> said: Is there a way to see what sql sa is sending to the database ? engine.echo = True will echo just the sql to screen (actually the looger output but that defal

[Sqlalchemy-users] Log of generated sql ?

2006-02-01 Thread Huy Do
Hi All, Is there a way to see what sql sa is sending to the database ? Man this library is so damn good I can't believe how easy it is to use. I've been writing an auto web database admin interface (in myghty) based on the SA mappers and models and damn it is so easy. There is so much power

[Sqlalchemy-users] Mapper access from foreign key

2006-01-29 Thread Huy Do
Hi, Just wondering if there was something built into sqlalchemy which would give me the mapper to a foreign key table. eg. Project.c.employee_id.foreign_key I could use a dict to map it myself and return the appropriate mapper but was hoping for a shortcut. Thanks Huy --

[Sqlalchemy-users] Mapper access from foreign key

2006-01-29 Thread Huy Do
Hi, Just wondering if there was something built into sqlalchemy which would give me the mapper to a foreign key table. eg. Project.c.employee_id.foreign_key I could use a dict to map it myself and return the appropriate mapper but was hoping for a shortcut. Thanks Huy