Re: [DB-SIG] paramstyles (mysql string length?)
by Gerhard Häring other posts by this author
Apr 19 2006 8:37AM messages near this date
Re: [DB-SIG] paramstyles (mysql string length?)
|
Re: [DB-SIG] paramstyles (mysql string length?)
M.-A. Lemburg wrote:
> [...]
> If that's the case, then I suppose supporting qmark style
> wouldn't be too much of a problem.
It's doable, but it requires parsing the SQL, i. e. find all the qmarks
that are not inside SQL string literals.
Databases like MySQL, PostgreSQL (*) and SQLite 2.x don't natively
support parameter binding, so the Python adapter will end up quoting
parameters and stuffing them in the query string.
Which is why these modules just use (py)format now, then they only need
to quote the parameters appropriately. The rest they get for free from
Python.
Abolishing (py)format certainly means additional work for the module
authors. If we do so - I haven't read the whole thread, so I don't know
what the arguments are for it - then we should include example code in
the DB-API for parsing qmarks out of ANSI SQL statements.
-- Gerhard
(*) Only in a stupid, nontransparent form.
_______________________________________________
DB-SIG maillist - DB-SIG@[...].org
http://mail.python.org/mailman/listinfo/db-sig
Thread:
Lukasz Szybalski
Andrew Chambers
Lukasz Szybalski
Andy Todd
Engelbert Gruber
Andy Todd
Engelbert Gruber
Lukasz Szybalski
Lukasz Szybalski
Andy Todd
Lukasz Szybalski
M.-A. Lemburg
Ian Bicking
Gerhard Häring
Ian Bicking
Carsten Haese
Gerhard Häring
Carsten Haese
Carsten Haese
Python
Engelbert Gruber
Andy Dustman
|