summaryrefslogtreecommitdiff
path: root/caching-tests/bench.ur
diff options
context:
space:
mode:
Diffstat (limited to 'caching-tests/bench.ur')
-rw-r--r--caching-tests/bench.ur16
1 files changed, 16 insertions, 0 deletions
diff --git a/caching-tests/bench.ur b/caching-tests/bench.ur
new file mode 100644
index 00000000..2661bd0e
--- /dev/null
+++ b/caching-tests/bench.ur
@@ -0,0 +1,16 @@
+table tab : {Id : int, Val : int} PRIMARY KEY Id
+
+fun check id =
+ res <- oneOrNoRows (SELECT tab.Val FROM tab WHERE tab.Id = {[id]});
+ return <xml><body>
+ Value at {[id]} is
+ {case res of
+ None => <xml>unknown</xml>
+ | Some row => <xml>{[row.Tab.Val]}</xml>}.
+ </body></xml>
+
+fun flush id =
+ dml (UPDATE tab SET Val = Val + 1 WHERE Id = {[id]});
+ return <xml><body>
+ Incremented value at {[id]} (if it exists).
+ </body></xml>