Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Vernon D. Cole
Dan: You have a very good point. Perhaps we should put that on the wish list for API version 3. The .connection attribute of the cursor is optional. IMHO it should be required.. I think most existing api packages implement it. The it is suggested, but not required by the PEP, that the excepti

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Daniel Lenski
On Fri, Apr 19, 2013 at 11:46 AM, Michael Bayer wrote: > > On Apr 19, 2013, at 1:56 PM, Dan Lenski wrote: > >> The problem I'm having is... how can I figure out what are the appropriate >> type objects for this comparison if I *only* have access to the cursor >> object? > > > Basically I'd quest

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Michael Bayer
On Apr 21, 2013, at 9:39 PM, Daniel Lenski wrote: > > I *could* pass around a handle to the DB module along with the cursor > itself, as you've suggested, but that seems redundant and error-prone > to me. To my mind, this is a small gap in the DBAPI design: > (1) DBAPI does specify a set of m

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Dan Lenski
Vernon D. Cole gmail.com> writes: > Dan: > You have a very good point.  Perhaps we should put that on the wish list for API version 3. > The .connection attribute of the cursor is optional.  IMHO it should be required..  I think most existing api packages implement it. > The it is suggested, b

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Dan Lenski
Michael Bayer zzzcomputing.com> writes: > On Apr 21, 2013, at 9:39 PM, Daniel Lenski gmail.com> wrote: > > > > > I *could* pass around a handle to the DB module along with the cursor > > itself, as you've suggested, but that seems redundant and error-prone > > to me. To my mind, this is a sma

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Michael Bayer
On Apr 22, 2013, at 12:44 PM, Dan Lenski wrote: > Michael Bayer zzzcomputing.com> writes: > >> On Apr 21, 2013, at 9:39 PM, Daniel Lenski gmail.com> wrote: >> >>> >>> I *could* pass around a handle to the DB module along with the cursor >>> itself, as you've suggested, but that seems redund

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Dan Lenski
Michael Bayer zzzcomputing.com> writes: > On Apr 22, 2013, at 12:44 PM, Dan Lenski 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 o

Re: [DB-SIG] checking column types from cursor object in a database-independent way?

2013-04-22 Thread Vernon D. Cole
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 ha