[DB-SIG] checking column types from cursor object in a database-independent way?
Vernon D. Cole
vernondcole at gmail.com
Tue Apr 23 00:51:00 CEST 2013
One of those attributes needs to move anyway. In order to make the
paramstyle switchable, it needs to be an attribute of the connection, so
that a client who is supporting multiple connections to multiple engines
(like, for example the database connection server I am writing right now)
does not have trouble with the different streams stepping on each other.
Most of the cruft is already hanging on the connection, and taking it out
would break too much old code -- so we might as well put to remaining cruft
On Mon, Apr 22, 2013 at 4:24 PM, Dan Lenski <dlenski at gmail.com> wrote:
> Michael Bayer <mike_mp <at> zzzcomputing.com> writes:
> > On Apr 22, 2013, at 12:44 PM, Dan Lenski <dlenski <at> gmail.com> wrote:
> > > I get your point about not crufting up DBAPI with a bunch of high-level
> > > features that will need to be reimplemented for each module...
> > >
> > > But this seems to me precisely the kind of feature that *should* exist
> > > this level, because it makes it easier for higher-level interfaces to
> > > manipulate the underlying database objects in a generic way without
> > > around extra module-dependent state on their own.
> > well I will say that there is precedent for this specific request - the
> cursor.connection attribute is part
> > of the spec, and is pretty harmless, and the spec also includes the
> for the DBAPI exception classes
> > to be attached onto the Connection, which you can see here:
> > http://www.python.org/dev/peps/pep-0249/#optional-db-api-extensions. If
> we're sticking the
> > module-level exception classes directly onto the connection (which I find
> kind of distasteful, but
> > there it is), might as well put *all* module-level constants onto it.
> Ah yes, that is quite a similar case.
> Since DBAPI specifies all these constants at the module-level, why not just
> include connection.module and cursor.module attributes to make them
> DB-SIG maillist - DB-SIG at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the DB-SIG