build sql strings from structured data
where
expression buildersql-select
return sql stringslists represent logical conditions:
every
/ any
/ not
(default = every
)(column value)
or (operator column value)
= > >= < <= like isnot
(and synonyms)or
), or tree list (nested or
/and
)(sql-select "t" ("c1" "c2") '((any (c1 2) (not (like c1 3))) (every (c2 (4 5)))))
produces
select c1,c2 from t where (c1=2 or not c1 like 3) and (c2=4 and c2=5)
(sql-value 1 "1" "a" "'a'") (sql-where-expr ((("a" 1))) "a=1" ((not ("a" 1))) "not a=1") (sql-create-table ("t" "c") "create table t(c)") (sql-select ("t" "c" (("a" 1) ("b" "2"))) "select c from t where a=1 and b='2'") (sql-insert ("t" (("a" . 1) ("b" . "2"))) "insert into t(a,b)values(1,'2')") (sql-update ("t" "c") "update t set c")
(sql-select "mytable m" "col1, col2")