Re: [sqlalchemy] NUMERIC in sqlite

2010-10-06 Thread Michael Bayer
On Oct 5, 2010, at 11:34 PM, csingley wrote: Hi, I'm just learning to use sqlalchemy now (although I've had some exposure to SQLObject and Django ORM, so not completely new to the game). I'd like to address a standard ORM issue - i.e. interfacing Python Decimal objects with SQLite

Re: [sqlalchemy] NUMERIC in sqlite

2010-10-06 Thread Christopher Singley
Thanks for the reply! On Wed, Oct 6, 2010 at 9:06 AM, Michael Bayer mike...@zzzcomputing.com wrote: SQlite has no lossless DECIMAL type and SQLAlchemy can't work around that. Well SQLAlchemy itself suggests workarounds that it doesn't implement, so here we are... The approaches to working

Re: [sqlalchemy] NUMERIC in sqlite

2010-10-06 Thread Michael Bayer
On Oct 6, 2010, at 11:00 AM, Christopher Singley wrote: Thanks for the reply! On Wed, Oct 6, 2010 at 9:06 AM, Michael Bayer mike...@zzzcomputing.com wrote: SQlite has no lossless DECIMAL type and SQLAlchemy can't work around that. Well SQLAlchemy itself suggests workarounds that it

Re: [sqlalchemy] NUMERIC in sqlite

2010-10-06 Thread Conor
On 10/06/2010 10:00 AM, Christopher Singley wrote: [...] 2. store the decimals as integers, using a type with a fixed exponent. Use Integer, and place a TypeDecorator around it which multiplies Decimal objects upwards by the fixed exponent going in and back down going out. Is it as

Re: [sqlalchemy] NUMERIC in sqlite

2010-10-06 Thread Christopher Singley
On Wed, Oct 6, 2010 at 10:12 AM, Michael Bayer mike...@zzzcomputing.com wrote: Well such a type wouldn't be backend agnostic.  The String/Integer wrapped one would act very differently than a Numeric.   So not much point in a transparent switch like that.   We try to keep switches like that

[sqlalchemy] NUMERIC in sqlite

2010-10-05 Thread csingley
Hi, I'm just learning to use sqlalchemy now (although I've had some exposure to SQLObject and Django ORM, so not completely new to the game). I'd like to address a standard ORM issue - i.e. interfacing Python Decimal objects with SQLite backend. It seems that sqlalchemy follows the standard