On 09-08-30 19:39, Marijn Haverbeke wrote:
Hi,
You'll notice that, even without your patch, something like (:currval "foo") expands to currval('foo') -- it's just a function, and when no special syntax is defined for a keyword, S-SQL will expand it as a function. Given this, does the patch still serve a purpose?
I don't know if I do it correctly, but without my patch: * (s-sql:sql-compile '(:select (:currval players_id_seq)))
"(SELECT currval(players_id_seq))"
With my patch: * (s-sql:sql-compile '(:select (:currval players_id_seq)))
"(SELECT currval(E'players_id_seq'))"
It seems that the default function expansion doesn't escape object names.
Since I'm here, note that there's also a setval() function, a bit more complex since it takes arguments (two or three), but I didn't figure how to add it (sorry, lisp beginner here). I'll try to add it... one day.
Regards,