[sqlalchemy] Re: help with a tricky property mapping

2009-04-14 Thread Dusty Phillips
On Apr 13, 5:16 pm, a...@svilendobrev.com wrote: mapper(Document, documents, properties={     'document_id': documents.c.id,   # document_id ORM property In the past, I have successfully mapped these properties using synonym, but this time I'm confused because I'm not sure how to

[sqlalchemy] Re: help with a tricky property mapping

2009-04-14 Thread Dusty Phillips
On Apr 14, 10:33 am, a...@svilendobrev.com wrote: On Tuesday 14 April 2009 16:56:41 Dusty Phillips wrote: On Apr 13, 5:16 pm, a...@svilendobrev.com wrote: mapper(Document, documents, properties={     'document_id': documents.c.id,   # document_id ORM property In the past, I have

[sqlalchemy] Re: help with a tricky property mapping

2009-04-14 Thread Dusty Phillips
On Apr 14, 11:03 am, a...@svilendobrev.com wrote: On Tuesday 14 April 2009 17:50:06 Dusty Phillips wrote: On Apr 14, 10:33 am, a...@svilendobrev.com wrote: On Tuesday 14 April 2009 16:56:41 Dusty Phillips wrote: On Apr 13, 5:16 pm, a...@svilendobrev.com wrote: mapper(Document

[sqlalchemy] help with a tricky property mapping

2009-04-13 Thread Dusty Phillips
Hi there, I've got a crappy legacy database that has a _rowid and an id column (they have totally separate meanings. In my orm, I want 'id' to map to _rowid and 'document_id' to map to id in the table. Easy enough -- I set it up like this: mapper(Document, documents, properties={

[sqlalchemy] Determining postgres sequence name for a table

2009-02-10 Thread Dusty Phillips
Hi there, I'm accessing a postgres database and would like to use the session.execute(Sequence('sequence_name')) syntax to get the next id for a table without actually saving the table. This all works fine if I know the sequence_name, but I was hoping to write generic code. Is it possible, using

[sqlalchemy] Convert type from dbapi description

2008-12-31 Thread Dusty Phillips
Hi there, I've been searching all over for a solution to this and have concluded that I must be doing it all wrong. I need to create a simple view of an arbitrary sql query result that includes the column names and types as a string (eg: integer, varchar, etc) as well as a summary of the row

[sqlalchemy] Session insert issues with a new dialect.

2008-12-09 Thread Dusty Phillips
I'm trying to fix/finish a half-broken dialect for OpenBase that was handed to me. I haven't gotten so far as using the SQLAlchemy test suite yet (OpenBase makes unit testing hard because a sequence of Create/drop messages deadlocks the db server, which is what tests normally do in setUp and

[sqlalchemy] Issues with Connection Pools

2008-11-17 Thread Dusty Phillips
1 = noah;'}) self.assert_(content.startswith(QueryResults)) threads = [] for i in range(20): thread = BridgeRequest() thread.start() threads.append(thread) for thread in threads: thread.join() I get a bunch of errors like this on the server: