add `call' syntax to allow calling of arbitrary functions

master
Moritz Heidkamp 13 years ago
parent 4f63ddbbb0
commit 69915c5082

@ -137,6 +137,15 @@
((insert (('into table) rest ...)) ((insert (('into table) rest ...))
(self 'insert table rest)) (self 'insert table rest))
((call (function args ...))
(sprintf "~A(~A)"
function
(string-intersperse
(map (lambda (arg)
(self 'ssql->sql arg #t))
args)
", ")))
((operator->sql type operator separator operands) ((operator->sql type operator separator operands)
(case type (case type
((infix) ((infix)

@ -64,4 +64,8 @@
(test-group "syntax" (test-group "syntax"
(test "set literals" (test "set literals"
"SELECT one, two FROM (1, 2)" "SELECT one, two FROM (1, 2)"
(ssql->sql #f '(select (columns one two) (from #(1 2)))))) (ssql->sql #f '(select (columns one two) (from #(1 2)))))
(test "function calls"
"SELECT foo(99, (bar('baz')))"
(ssql->sql #f '(select (call foo 99 (call bar "baz"))))))
Loading…
Cancel
Save