comparison sqlcache-tests/test.ur @ 2202:606af2c9b828

Identifies tables read or touched by queries.
author Ziv Scully <ziv@mit.edu>
date Sat, 08 Mar 2014 05:06:22 -0500
parents
children
comparison
equal deleted inserted replaced
1994:94529780bbcf 2202:606af2c9b828
1 table foo : {Id : int, Bar : string} PRIMARY KEY Id
2
3 (* val query = (SELECT * FROM foo WHERE foo.Bar = "baz") *)
4 (* val insert = (INSERT INTO foo (Id, Bar) VALUES (42, "baz")) *)
5
6 fun main () : transaction page =
7 dml (INSERT INTO foo (Id, Bar) VALUES (42, "baz"));
8 res <- oneOrNoRows (SELECT foo.Id, foo.Bar
9 FROM foo
10 WHERE foo.Bar = "baz"
11 UNION
12 SELECT *
13 FROM foo
14 WHERE foo.Bar = "qux");
15 return
16 <xml>
17 <body>
18 {case res of
19 None => <xml></xml>
20 | Some row => <xml>{[row.Foo.Bar]}</xml>}
21 </body>
22 </xml>