On 19-05-2013, Carl Karsten wrote:

> I don't think it is reasonable to expect python's dbapi to be as db
> agnostic as we would like it to be. 

Of course, we will not resolv this issue, sql code will still be 
specific to database.

But, as a developer using differents databases, even if i accept to 
write specific sql code, i like to use the same paramstyle. So i wrote 
my own paramstyle with $x and write a litle wrapper to database 
paramstyle (and i will gain 2 lines of code if i could know the 
paramstyle from the connection).  My own because it's a lot of corner 
cases and i prefer to know exactly what i do...

Don't forget that a lot of developers tired of paramstyle 
incompatibilities don't use any of them and use string concatenation 
instead !

What do you think about qmark mandatory and an sqlparamters function in 
stdlib ?
Maybe an extension of string format, it could be fine to can do:

i = "update mytable set x={v}".sqlformat
cursor.execute(i(v=5))


-- 
William Dodé
Informaticien Indépendant

_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to