[DB-SIG] New update for DB API 1.1
Wed, 24 Mar 1999 13:22:00 -0500 (EST)
On Wed, 24 Mar 1999, M.-A. Lemburg wrote:
> I've (finally) updated the DB API 1.1 proposal with all the new
> enhancements and also added a list of open issues:
Okay, hopefully this will end up being the last round of comments and we
can wrap this up soon:
paramstyle: Historically, because of the way MySQL works, the interfaces
have used the "percent" style. However, it would also be fairly easy to
also implement the "xpercent" style. From an implementation standpoint,
this could mean having an alternate executedict method which is like
execute but expects a dictionary. Or, executeobject which is like
executedict but expects an object and uses it's __dict__. (This last one,
unfortunately, avoids use of __getattr__, which is probably a bad thing.)
Possibly execute could test to see if a dictionary is present and use the
"xpercent" style instead of "percent". Anyway, the real point is: Multiple
paramstyles are possile for a given database. The two obvious combinations
are "percent" and "xpercent" and possibly "qmark" or "numeric" and
Might I also suggest a renaming? Use "format" for the ANSI C type format
strings and "dictformat" for Python type named format strings.
Another question is: Does anyone think it would be particularly beneficial
to allow execute or a varient to work on a dictionary? I think it could
be, though I'm not sure I would personally use it. I have a module
(SQLDict) that lets me define Python objects based on a list of column
names, and these objects can "register" with a SQLDict connection which
then creates the necessary SQL for inserting, updating, and deletion. So
the dictionary feature would not be much use to me, but could be useful
for other applications.
Lastly, I'm not sure why the buffer object should be the preferred object
for binary data. I did "discover" them at one point. Basically they seem
to be mutable strings. Well, really just a C-style buffer. I guess I don't
see the benefit over using strings. If the normal string/sequence
operations are available, I suppose it's not a big problem.
BTW, I do have permission to release the new MySQL interface. I am waiting
on word that the lawyers have approved the licensing agreement. Don't
worry, it's the Python license with the words "Stichting Mathematisch
Centrum" scratched out and "ComStar Communications Corporation" written in
with a crayon, and we get rights to your internal organs (by reading this
message, you have consented to be bound to the license agreement and
other terms we may think up later).
Andy Dustman (ICQ#32922760) You should always say "spam" and "eggs"
ComStar Communications Corp. instead of "foo" and "bar"
(706) 549-7689 | PGP KeyID=0xC72F3F1D in Python examples. (Mark Lutz)