diff options
author | Ziv Scully <ziv@mit.edu> | 2015-11-04 20:12:07 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2015-11-04 20:12:07 -0500 |
commit | 2e9eb1c2b1b1279e627034b6bfbfb86e4f2bfba7 (patch) | |
tree | ee461b8b02043652c7fcc1d0f99479f7d5ede79c /caching-tests | |
parent | aec3d37bda5c0b7068e92e31bf903545f953adba (diff) |
Consildation of caches understands sqlification.
Diffstat (limited to 'caching-tests')
-rw-r--r-- | caching-tests/test.ur | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/caching-tests/test.ur b/caching-tests/test.ur index 00f05768..338f9236 100644 --- a/caching-tests/test.ur +++ b/caching-tests/test.ur @@ -11,15 +11,29 @@ 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]}); +(* 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 cache2 id1 id2 = + res1 <- oneOrNoRows (SELECT tab.Val + FROM tab + WHERE tab.Id = {[id1]}); + res2 <- oneOrNoRows (SELECT tab.Val + FROM tab + WHERE tab.Id = {[id2]}); return <xml><body> - Reading {[id]}. - {case res of - None => <xml>Nope, that's not it.</xml> - | Some _ => <xml>Hooray! You guessed it!</xml>} + Reading {[id1]} and {[id2]}. + {case (res1, res2) of + (Some _, Some _) => <xml>Both are there.</xml> + | _ => <xml>One of them is missing.</xml>} </body></xml> fun flush id = |