summaryrefslogtreecommitdiff
path: root/caching-tests
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
parentf3ca4cbdd84e1d86f47d1cbabc8ad881e0adfeb2 (diff)
Make SQL caches use more of the pure caching machinery, but it's brittle.
Diffstat (limited to 'caching-tests')
-rw-r--r--caching-tests/test.ur11
-rw-r--r--caching-tests/test.urs1
2 files changed, 12 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
diff --git a/caching-tests/test.urs b/caching-tests/test.urs
index e9e09ac8..fc23c47d 100644
--- a/caching-tests/test.urs
+++ b/caching-tests/test.urs
@@ -1,3 +1,4 @@
val cache : int -> transaction page
+val cache2 : int -> int -> transaction page
val flush : int -> transaction page
val flush17 : transaction page