ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> db-sig
db-sig
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved