It happens that the statement "there is no reliable way to distinguish a
mapping from a sequence" is not true. I submit the following example.
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more infor
Tony Locke wrote at 2013-9-13 18:54 +0100:
> ...
>I thought I'd give a suggestion for unified parameters. Apologies if
>this has been suggested before, I did have a look at the archives :-)
>
>In DBAPI 2.0, the parameters to execute() can be a sequence or a
>mapping. In DBAPI 3.0, the paramstyle at
Just for fun I've put up a version of pg8000 that works without a
paramstyle parameter:
https://github.com/tlocke/pg8000/tree/three
In this version, you can do:
execute("select * from emp where name = :1", ['horatio'])
or:
execute("select * from emp where name = :name", {'name': 'horatio'})
T
Tony:
I should also mention that the reason that "qmark" ("?") delimiters were
selected as the choice for specified-by-order parameter markers, rather
than "numeric" (":n") in simply popularity. Postgres is pretty much alone
in using numeric, where several other popular databases all use qmark.
Tony:
You are not the first one to notice that .paramstyle is rather an obtuse
and ungainly creature.
I also submitted a suggestion that introspection of the second argument
to exectute() could potentially make it nearly obsolete (when there are
only two alternative choices). As you have see
Am 16.09.2013 09:51, schrieb M.-A. Lemburg:
Perhaps I should update the page with a summary of what we've been
discussing here.
If you can find some time for it, that would be really helpful.
-- Christoph
___
DB-SIG maillist - DB-SIG@python.org
h
The wiki page is somewhat out of date and doesn't really reflect
what we've been discussing here on the list recently.
We're currently aiming for making the .paramstyle a user adjustable
setting and requiring support for two paramstyles 'qmark' and 'named',
while keeping the other paramstyles arou
Hi, I'm a contributor to the PG8000 Postgres driver:
https://github.com/mfenniak/pg8000/tree/py3
Having read the interesting DBAPI 3.0 wiki page:
https://wiki.python.org/moin/DbApi3
I thought I'd give a suggestion for unified parameters. Apologies if
this has been suggested before, I did have a