[sqlalchemy] SQLAlchemy 0.7.6 Released

2012-03-14 Thread Michael Bayer
Hi all - As my final task for Pycon 2012, I've put out release 0.7.6 of SQLAlchemy. For anyone using 0.7.5, this release is strongly recommended as it fixes a memory leak issue which was introduced in the C extensions as of version 0.7.5 (see issue #2427). Release 0.7.6 also includes some nif

[sqlalchemy] Bidirectional, self-referential association table

2012-03-14 Thread Jon Parise
I'm considering modeling many-to-many "friend" relationships between users using an association table. The tricky aspect is that I'd like the association table's entries to be "bidirectional", meaning the single entry (A,B) represents friendship in both directions. The "standard" way to model thi

Re: [sqlalchemy] Reflecting user defined types

2012-03-14 Thread Michael Bayer
On Mar 14, 2012, at 4:45 AM, marq wrote: > Hello, > > I'm a beginner in SQLAlchemy - apologies if I'm asking for the > obvious... > > I have a user defined type for Oracle (w/ SQLAlchemy 0.7.5) > > class OracleBinaryDouble(sqlalchemy.types.UserDefinedType): > >"""Native double /

Re: [sqlalchemy] Only one record with parent_id of None; constraint possible?

2012-03-14 Thread Conor
On 03/14/2012 06:37 AM, Daniel Nouri wrote: > On Tue, Mar 13, 2012 at 5:03 PM, Conor wrote: >> On 03/13/2012 09:21 AM, Daniel Nouri wrote: >> >> I have a node with a parent_id, which may be None (for the root node). >> Can I make a SQL table constraint that says: 'there may only be one >> node wi

Re: [sqlalchemy] Preload data in memory

2012-03-14 Thread Michael Bayer
On Mar 14, 2012, at 5:23 AM, Thibaud Roussillat wrote: > Hi, > > I work with sqlalchemy v 0.4 (not possible to migrate to new versions > quickly) and I try to improve my application's performance because I > have to play with big sets of data contained in two tables. > > I have table A and tabl

Re: [sqlalchemy] Replacing columns in a Select

2012-03-14 Thread Michael Bayer
On Mar 14, 2012, at 7:50 AM, Ronan Dunklau wrote: > Hello. > > I'd like to append a column clause to a select, or replace an existing > column if one exists with the same key. > > I've seen that ColumnCollection has a convenient 'replace' method, but I > don't know how to achieve that with a se

[sqlalchemy] Preload data in memory

2012-03-14 Thread Thibaud Roussillat
Hi, I work with sqlalchemy v 0.4 (not possible to migrate to new versions quickly) and I try to improve my application's performance because I have to play with big sets of data contained in two tables. I have table A and table B with a one-to-many relation (table B contain a foreign key to table

[sqlalchemy] Replacing columns in a Select

2012-03-14 Thread Ronan Dunklau
Hello. I'd like to append a column clause to a select, or replace an existing column if one exists with the same key. I've seen that ColumnCollection has a convenient 'replace' method, but I don't know how to achieve that with a select instance. I can achieve what I want with the following code:

[sqlalchemy] Reflecting user defined types

2012-03-14 Thread marq
Hello, I'm a beginner in SQLAlchemy - apologies if I'm asking for the obvious... I have a user defined type for Oracle (w/ SQLAlchemy 0.7.5) class OracleBinaryDouble(sqlalchemy.types.UserDefinedType): """Native double / double precision floating point data type for Oracle

Re: [sqlalchemy] Only one record with parent_id of None; constraint possible?

2012-03-14 Thread Daniel Nouri
On Tue, Mar 13, 2012 at 5:03 PM, Conor wrote: > On 03/13/2012 09:21 AM, Daniel Nouri wrote: > > I have a node with a parent_id, which may be None (for the root node). > Can I make a SQL table constraint that says: 'there may only be one > node with the parent_id of None' (while it's fine if many