Hi,
Am I correct in thinking that there is currently no way to parameterize raw SQL strings to be sent through postmodern? I realize most SQL can be expressed as S-SQL but it doesn't seem to support COPY syntax yet. I added the function `sql-fmt' for this purpose and am submitting it to the list in case it's useful for others....
(defun sql-fmt (fmt &rest args) (apply 'format nil fmt (mapcar 'sql-ize args)))
In my repo [1], I added this to the :export list of both s-sql and postmodern packages. Please pull the change or let me know if you need this changed in any way.
[1]: https://github.com/cddr/Postmodern/commits/master
Cheers, Andy
Hi Andy,
I also just replied on github -- basically, you can just *use* raw strings wherever Postmodern expects an s-sql expression (the two can be distinguished at compile time) and it will work.
Best, Marijn
Andy,
Am I correct in thinking that you are pointing out that while (query "select name from countries where id=$1" 27) (("Singapore"))
works
(query "copy $1 to$2" "countries" "/home/sabra/test/test.dat")
does not work?
Sabra
On Fri, Nov 12, 2010 at 8:07 PM, achambers@mcna.net wrote:
Hi,
Am I correct in thinking that there is currently no way to parameterize raw SQL strings to be sent through postmodern? I realize most SQL can be expressed as S-SQL but it doesn't seem to support COPY syntax yet. I added the function `sql-fmt' for this purpose and am submitting it to the list in case it's useful for others....
(defun sql-fmt (fmt &rest args) (apply 'format nil fmt (mapcar 'sql-ize args)))
In my repo [1], I added this to the :export list of both s-sql and postmodern packages. Please pull the change or let me know if you need this changed in any way.
Cheers, Andy
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Yes. That's what I'm saying.
Marijnh provided a work-around with the following commit...
https://github.com/marijnh/Postmodern/commit/d1f46a1c2b80a80861bafad7498fd63...
-- Andy
postmodern-devel@common-lisp.net