Hi again Marijn,
On Wed, 2008-11-12 at 00:42 +0100, Marijn Haverbeke wrote:
This isn't currently supported by S-SQL. Feel free to propose a syntax. The current one (which tries to resemble UPDATE) is rather unsuitable for this. Maybe we could add a new operator. :insert-rows-into?
Creating a new operator sounds like a good idea. I've attached a patch that implements the operator, let me know if it's good enough to apply to your repo :)
It works like so: (:insert-rows-into 'pg-table :columns ('a 'b 'c) :values ((1 2 3) (4 5 6)))
It does length-checking against the columns and values lists, allows omission of the columns list, and includes RETURNING support.
Yes, if you want the unwind-protect automatic cleanup you'll have to use with-transaction. You're free to just do (execute "begin"), (execute "commit") etcetera, of course.
Great, thanks :)
Regards, Harry
Cheers, Marijn
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel