|
|
@ -26,7 +26,7 @@
|
|
|
|
(let ((ssql-op (first op))
|
|
|
|
(let ((ssql-op (first op))
|
|
|
|
(type (second op)))
|
|
|
|
(type (second op)))
|
|
|
|
|
|
|
|
|
|
|
|
(unless (memq (strip-syntax type) '(infix suffix prefix function))
|
|
|
|
(unless (memq (strip-syntax type) '(infix infix* suffix prefix function))
|
|
|
|
(error "unknown operator syntax type" type))
|
|
|
|
(error "unknown operator syntax type" type))
|
|
|
|
|
|
|
|
|
|
|
|
(let-optionals (cddr op)
|
|
|
|
(let-optionals (cddr op)
|
|
|
@ -86,11 +86,15 @@
|
|
|
|
((operator->sql type operator separator operands)
|
|
|
|
((operator->sql type operator separator operands)
|
|
|
|
(case type
|
|
|
|
(case type
|
|
|
|
((infix)
|
|
|
|
((infix)
|
|
|
|
(sprintf "(~A)" (string-intersperse
|
|
|
|
(sprintf "(~A)" (self 'operator->sql 'infix* operator separator operands)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
((infix*)
|
|
|
|
|
|
|
|
(string-intersperse
|
|
|
|
(map (lambda (operand)
|
|
|
|
(map (lambda (operand)
|
|
|
|
(self 'ssql->sql operand))
|
|
|
|
(self 'ssql->sql operand))
|
|
|
|
operands)
|
|
|
|
operands)
|
|
|
|
(string-append " " operator " "))))
|
|
|
|
(string-append " " operator " ")))
|
|
|
|
|
|
|
|
|
|
|
|
((function)
|
|
|
|
((function)
|
|
|
|
(sprintf "~A(~A)"
|
|
|
|
(sprintf "~A(~A)"
|
|
|
|
operator
|
|
|
|
operator
|
|
|
@ -138,7 +142,7 @@
|
|
|
|
(order prefix "ORDER BY" ", ")
|
|
|
|
(order prefix "ORDER BY" ", ")
|
|
|
|
(having prefix)
|
|
|
|
(having prefix)
|
|
|
|
(union infix)
|
|
|
|
(union infix)
|
|
|
|
(as infix)
|
|
|
|
(as infix*)
|
|
|
|
(asc suffix)
|
|
|
|
(asc suffix)
|
|
|
|
(desc suffix)
|
|
|
|
(desc suffix)
|
|
|
|
(on prefix)
|
|
|
|
(on prefix)
|
|
|
|