On Nov 4, 2005, at 11:45 PM, Paul McNett wrote:

Seems like based on my first few tests, PySQLite doesn't handle Decimal at all; I get the error: "pysqlite2.dbapi2.InterfaceError: Error binding parameter 1 - probably unsupported type.". If I change that value to a float, it works, but I get back a float. It also totally hoses dates, but I saw on the pysqlite website that there are converter routines for datetimes, so maybe there are some for date values, too.

Right, and there will likely be ways to handle decimal too, even if we have to roll that on our own. Isn't pysqlite completely implemented in Python (I could be wrong)?

pysqlite has built-in facilities for this. You can specify 'adapters' and 'converters' for storing and retrieving data types that are not natively supported in SQLite. I've already written the Decimal functions; as we run into more unsupported types, we'll have to add additional functions.

I just got kind of freaked out thinking that we were going to try to implement all this ourselves, when we've already committed to implementing other daunting things (ide, report designer, etc.).

My goal wasn't to implement it all; just some basic querying and joining. But there isn't any reason to do the simple stuff one way and the complex stuff another if there is no objection to adding another dependency. BTW, I'm being careful to wrap all references to SQLite-dependent stuff. If they don't have it installed, the functions will return None instead of crashing. I've just added error log messages to the code letting the developer know why they aren't getting any results.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to