summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-06-25 14:19:58 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2014-06-25 14:19:58 -0400
commit2000d8de5719e6a3aa94dd3f52c9dc3c1170c9fa (patch)
treeb2af1a649be8a943dac091e295f52b5b08f63459 /tests
parent4d2154f281d63408567a4f063dc4a5f9846cbf44 (diff)
Finish example
Diffstat (limited to 'tests')
-rw-r--r--tests/tags.ur5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/tags.ur b/tests/tags.ur
index 1213d824..059e869a 100644
--- a/tests/tags.ur
+++ b/tests/tags.ur
@@ -11,7 +11,10 @@ fun addCondition (c : condition) (q : tag_query) : tag_query =
Present => (SELECT I.Id AS Id
FROM ({{q}}) AS I
JOIN tags ON tags.Id = I.Id AND tags.Tag = {[c.Tag]})
- | Absent => q
+ | Absent => (SELECT I.Id AS Id
+ FROM ({{q}}) AS I
+ LEFT JOIN tags ON tags.Id = I.Id AND tags.Tag = {[c.Tag]}
+ WHERE tags.Tag IS NULL)
fun withConditions (cs : list condition) : tag_query =
List.foldl addCondition (SELECT images.Id AS Id FROM images) cs