From a723338316058e32ebd27e97a0ccb3ec56cb54a6 Mon Sep 17 00:00:00 2001 From: Moritz Heidkamp Date: Thu, 18 Aug 2011 17:08:04 +0200 Subject: [PATCH] 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 --- ssql.scm | 3 +++ tests/ansi-test.scm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ssql.scm b/ssql.scm index dacfbe8..083a565 100644 --- a/ssql.scm +++ b/ssql.scm @@ -116,6 +116,9 @@ values) ", "))) + ((table (table)) + (symbol->string table)) + ((insert into rest) (sprintf "INSERT INTO ~A ~A" into diff --git a/tests/ansi-test.scm b/tests/ansi-test.scm index b267e14..3de15f5 100644 --- a/tests/ansi-test.scm +++ b/tests/ansi-test.scm @@ -30,11 +30,11 @@ (test-group "updates" (test "simple case" "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" "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 "with sub-queries"