From f564b4316c3710c4ce178ff23570fc60b887c427 Mon Sep 17 00:00:00 2001 From: Moritz Heidkamp Date: Thu, 31 Mar 2011 21:04:22 +0200 Subject: [PATCH] add support for tuple literals as vectors --- ssql.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ssql.scm b/ssql.scm index 10e5b3f..b36fbd6 100644 --- a/ssql.scm +++ b/ssql.scm @@ -43,7 +43,8 @@ (,pair? . pair->sql) (,symbol? . source->sql) (,string? . string->sql) - (,number? . number->sql))) + (,number? . number->sql) + (,vector? . vector->sql))) ((clauses-order) '(columns from where order having union)) @@ -55,6 +56,13 @@ ((pair->sql pair) (self (car pair) (cdr pair))) + ((vector->sql vec) + (format "(~A)" + (string-intersperse + (map (lambda (s) (self 'ssql->sql s)) + (vector->list vec)) + ", "))) + ((string->sql string) (string-append "'" (self 'escape-string string) "'"))