summaryrefslogtreecommitdiff
path: root/caching-tests/test.ur
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-10-15 00:52:04 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2015-10-15 00:52:04 -0400
commitf425194d947691ceeaad9ec73fdc7c2c176ebfe3 (patch)
tree095cd90b01c8471239a8637b06506020b51832ac /caching-tests/test.ur
parentf3ca4cbdd84e1d86f47d1cbabc8ad881e0adfeb2 (diff)
Make SQL caches use more of the pure caching machinery, but it's brittle.
Diffstat (limited to 'caching-tests/test.ur')
-rw-r--r--caching-tests/test.ur11
1 files changed, 11 insertions, 0 deletions
diff --git a/caching-tests/test.ur b/caching-tests/test.ur
index 578d59b3..00f05768 100644
--- a/caching-tests/test.ur
+++ b/caching-tests/test.ur
@@ -11,6 +11,17 @@ fun cache id =
| Some row => <xml>{[row.Tab.Val]}</xml>}
</body></xml>
+fun cache2 id v =
+ res <- oneOrNoRows (SELECT tab.Val
+ FROM tab
+ WHERE tab.Id = {[id]} AND tab.Val = {[v]});
+ return <xml><body>
+ Reading {[id]}.
+ {case res of
+ None => <xml>Nope, that's not it.</xml>
+ | Some _ => <xml>Hooray! You guessed it!</xml>}
+ </body></xml>
+
fun flush id =
dml (UPDATE tab
SET Val = Val * (Id + 2) / Val - 3