On Tue, 24 Aug 2004, D. Richard Hipp wrote:
Matt Wilson wrote:
Normally python programmers would like to see named arguments in dictionary substation format:
d = { 'blob': 'a\0b', 'id': 2 } cursor.execute("UPDATE t1 SET value=%(bigblob)s WHERE rowid=%(id)d", d)
I'd be willing to extend the lexer/parser of SQLite to accept this kind of thing. The only problem here is that '%' is already used to mean the remainder-after-integer-division operator, like in C. Could another character be used instead? "@" perhaps? Or maybe two "%%" instead of just '%'?
perhaps
cursor.execute("UPDATE t1 SET value=#{ bigblob }s WHERE rowid=#{ id }d", d)
'#' commences the escape iff the next char is
[{(|"'!
the next balancing closing char
]})|"'!
respectively, closes the sequence.
it's really nice to be able to select the bracketing char (and not that had to implement) for complex escape nightmares in various langs.
2cts.
cheers.
-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it. | --Dogen
===============================================================================