[DB-SIG] RE: column type casting

M.-A. Lemburg mal@lemburg.com
Fri, 23 Mar 2001 16:39:35 +0100

brian zimmer wrote:
> Daniel,
> What's the API like for your datahandlers?  Are they written in C or Python?  Should we collect a couple examples and present them
> in the PEP?
> In addition to being able to handle different data types, the functionality might want to include events/callbacks for the lifecycle
> of the executions.  As I stated, this is useful for collecting the auto increment values for certain columns and isn't so much the
> morphing of data.

Good idea.

There seem to be a few things common to all implementations:

* settings are inherited from connection to cursor objects, but
  can be overridden on the cursor

* argument callback assignment is done in a positional way, meaning 
  that each argument can be handled individually

* type mappings map cursor.description type codes to converters

Perhaps we could agree on a common standard for these DB API
extensions and then add them as special DB API extension guideline
to the spec ?!

Marc-Andre Lemburg
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/