diff options
Diffstat (limited to 'caching-tests/test.ur')
-rw-r--r-- | caching-tests/test.ur | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/caching-tests/test.ur b/caching-tests/test.ur index e08c6e47..0549840d 100644 --- a/caching-tests/test.ur +++ b/caching-tests/test.ur @@ -5,7 +5,23 @@ fun cache id = FROM tab WHERE tab.Id = {[id]}); return <xml><body> - Reading {[id]}. + (* Reading {[id]}. *) + {case res of + None => <xml>?</xml> + | Some row => <xml>{[row.Tab.Val]}</xml>} + </body></xml> + +(* fun sillyRecursive {Id = id, FooBar = fooBar} = *) +(* if fooBar <= 0 *) +(* then 0 *) +(* else 1 + sillyRecursive {Id = id, FooBar = fooBar - 1} *) + +fun cacheR (r : {Id : int, FooBar : int}) = + res <- oneOrNoRows (SELECT tab.Val + FROM tab + WHERE tab.Id = {[r.Id]}); + return <xml><body> + (* Reading {[r.Id]}. *) {case res of None => <xml>?</xml> | Some row => <xml>{[row.Tab.Val]}</xml>} |