[sqlalchemy] Re: SQLite and decimal.Decimal

2007-04-10 Thread [EMAIL PROTECTED]

It would be great. Thank you.

André

On 7 abr, 12:57, Michael Bayer [EMAIL PROTECTED] wrote:
 the thing is, we have support for 6 different databases and postgres
 is the *only* one where its DBAPI implementation decides to use
 Decimal for numeric types.  the rest return just floats.  that
 means, people who have worked with databases other than postgres will
 be totally surprised to plug in SQLAlchemy one day and all the sudden
 they arent getting their expected float types back.  So i dont think
 one DBAPI should dictate the behavior for all DBAPIs, and its
 definitely not a bug.  its a feature request, asking for a generic
 numeric type that is guaranteed to return decimal.Decimal objects
 regardless of underlying DBAPI.

 So, I would rather add a new type called DecimalType that creates
 columns using NUMERIC semantics but explicitly returns
 decimal.Decimal objects.

 On Apr 7, 2007, at 9:16 AM, [EMAIL PROTECTED] wrote:



  Hi,

  I'm using SQLite in tests and there is a problem when using
  decimal.Decimal with sqlalchemy's Numeric type:

  SQLError: (InterfaceError) Error binding parameter 5 - probably
  unsupported type.

  This is not a new issue, a similar one was posted in
 http://groups.google.com/group/sqlalchemy/browse_thread/thread/
  300b757014c7d375/ad024f5365ab2eea

  It looks like a bug in sqlalchemy, but I'd rather discuss it here
  before creating a ticket. What I'd really like is that the Numeric
  field could work with decimal.Decimal in SQLite as it does with
  postgres, without any other external hack.

  Regards,

  André


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: SQLite and decimal.Decimal

2007-04-07 Thread Michael Bayer

the thing is, we have support for 6 different databases and postgres  
is the *only* one where its DBAPI implementation decides to use  
Decimal for numeric types.  the rest return just floats.  that  
means, people who have worked with databases other than postgres will  
be totally surprised to plug in SQLAlchemy one day and all the sudden  
they arent getting their expected float types back.  So i dont think  
one DBAPI should dictate the behavior for all DBAPIs, and its  
definitely not a bug.  its a feature request, asking for a generic  
numeric type that is guaranteed to return decimal.Decimal objects  
regardless of underlying DBAPI.

So, I would rather add a new type called DecimalType that creates  
columns using NUMERIC semantics but explicitly returns  
decimal.Decimal objects.


On Apr 7, 2007, at 9:16 AM, [EMAIL PROTECTED] wrote:


 Hi,

 I'm using SQLite in tests and there is a problem when using
 decimal.Decimal with sqlalchemy's Numeric type:

 SQLError: (InterfaceError) Error binding parameter 5 - probably
 unsupported type.

 This is not a new issue, a similar one was posted in
 http://groups.google.com/group/sqlalchemy/browse_thread/thread/ 
 300b757014c7d375/ad024f5365ab2eea

 It looks like a bug in sqlalchemy, but I'd rather discuss it here
 before creating a ticket. What I'd really like is that the Numeric
 field could work with decimal.Decimal in SQLite as it does with
 postgres, without any other external hack.

 Regards,

 André


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---