[DB-SIG] How to know what to do with parameters...

Anthony Tuininga anthony at computronix.com
Fri May 16 17:46:31 EDT 2003

I don't think Magnus is suggesting that the _dbapi_string() perform the
conversion or that the _dbapi_value() method that I suggested would
convert the string. That is still the domain of the DB API driver. All
that is needed is some way of defining the value that is to be bound to
the database driver in a way that is understandable by the driver. So if
I have an instance of type Money()

_dbapi_type() -> returns NUMBER
_dbapi_value() -> returns a Python string that can then be manipulated
by the driver as needed

Or is there something else that I am missing?

On Fri, 2003-05-16 at 10:37, Kevin Jacobs wrote:
> On Fri, 16 May 2003, Magnus Lyckå wrote:
> > I would like to suggest that the DB-API will stipulate
> > that the DBinterfaces should check whether an object has
> > a method of a certain, standardized name, and use that
> > method to extract the stringified value to put in the
> > SQL statement, it the object has such a method.
> This assumes that objects will only need to know how to encode themselves
> for a single known backend, or that all possible backends can rely on a
> single encoding.  Both are very bad assumptions.  (Not that most of the rest
> of the recent discussion on how to "fix" DB-API is not equally as flawed).
> If it were that easy, it would have already been done.  However, it is not
> an intractible problem, though it does _very_ quickly escape the scope of
> DB-API and deserves a distinct API layer of its own.
> -Kevin
Anthony Tuininga
anthony at computronix.com
Distinctive Software. Real People.
Suite 200, 10216 - 124 Street NW
Edmonton, AB, Canada  T5N 4A3
Phone:	(780) 454-3700
Fax:	(780) 454-3838

More information about the DB-SIG mailing list