From 4f63ddbbb090ba530911c0c8bcb8441a923b29fa Mon Sep 17 00:00:00 2001 From: Moritz Heidkamp Date: Mon, 22 Aug 2011 19:18:05 +0200 Subject: [PATCH] add support for DELETE statements --- ssql.scm | 1 + tests/ansi-test.scm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ssql.scm b/ssql.scm index 4a97d17..9d6b159 100644 --- a/ssql.scm +++ b/ssql.scm @@ -197,6 +197,7 @@ (define-operators *ansi-translator* (select prefix) (update prefix) + (delete prefix) (from prefix "FROM" ", ") (where prefix) (order prefix "ORDER BY" ", ") diff --git a/tests/ansi-test.scm b/tests/ansi-test.scm index 3de15f5..ec1d883 100644 --- a/tests/ansi-test.scm +++ b/tests/ansi-test.scm @@ -57,6 +57,10 @@ "INSERT INTO actors VALUES ('Marlon', 'Brando')" (ssql->sql #f '(insert (into actors) (values ("Marlon" "Brando")))))) +(test-group "deletes" + (test "DELETE FROM actors WHERE (id IN (10, 11, 93))" + (ssql->sql #f '(delete (from actors) (where (in id #(10 11 93))))))) + (test-group "syntax" (test "set literals" "SELECT one, two FROM (1, 2)"