change `(update widgets ...)' to `(update (table widgets) ...)' so as to not have a single symbol floating around there in order to make update statements composable

master
Moritz Heidkamp 13 years ago
parent d1de827a00
commit a723338316

@ -116,6 +116,9 @@
values) values)
", "))) ", ")))
((table (table))
(symbol->string table))
((insert into rest) ((insert into rest)
(sprintf "INSERT INTO ~A ~A" (sprintf "INSERT INTO ~A ~A"
into into

@ -30,11 +30,11 @@
(test-group "updates" (test-group "updates"
(test "simple case" (test "simple case"
"UPDATE actors SET firstname = 'Rube', lastname = 'Goldberg'" "UPDATE actors SET firstname = 'Rube', lastname = 'Goldberg'"
(ssql->sql #f '(update actors (set (firstname "Rube") (lastname "Goldberg"))))) (ssql->sql #f '(update (table actors) (set (firstname "Rube") (lastname "Goldberg")))))
(test "with condition" (test "with condition"
"UPDATE actors SET firstname = 'Felix' WHERE (lastname = 'Winkelmann')" "UPDATE actors SET firstname = 'Felix' WHERE (lastname = 'Winkelmann')"
(ssql->sql #f '(update actors (set (firstname "Felix")) (where (= lastname "Winkelmann")))))) (ssql->sql #f '(update (table actors) (set (firstname "Felix")) (where (= lastname "Winkelmann"))))))
(test-group "inserts" (test-group "inserts"
(test "with sub-queries" (test "with sub-queries"

Loading…
Cancel
Save