diff caching-tests/test.ur @ 2269:f7bc7c11a656

Make SQL caches use more of the pure caching machinery, but it's brittle.
author Ziv Scully <ziv@mit.edu>
date Thu, 15 Oct 2015 00:52:04 -0400
parents 200a7ed4343b
children a3cac6cea625
line wrap: on
line diff
--- a/caching-tests/test.ur	Wed Oct 14 23:10:10 2015 -0400
+++ b/caching-tests/test.ur	Thu Oct 15 00:52:04 2015 -0400
@@ -11,6 +11,17 @@
          | 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