From 2e9eb1c2b1b1279e627034b6bfbfb86e4f2bfba7 Mon Sep 17 00:00:00 2001 From: Ziv Scully Date: Wed, 4 Nov 2015 20:12:07 -0500 Subject: Consildation of caches understands sqlification. --- caching-tests/test.ur | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'caching-tests') 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 => {[row.Tab.Val]}} -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 *) +(* Reading {[id]}. *) +(* {case res of *) +(* None => Nope, that's not it. *) +(* | Some _ => Hooray! You guessed it!} *) +(* *) + +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 - Reading {[id]}. - {case res of - None => Nope, that's not it. - | Some _ => Hooray! You guessed it!} + Reading {[id1]} and {[id2]}. + {case (res1, res2) of + (Some _, Some _) => Both are there. + | _ => One of them is missing.} fun flush id = -- cgit v1.2.3