comparison tests/equalKnown.ur @ 1280:3d06e0f7a6f3

Initial version of equalKnown working for secret
author Adam Chlipala <adam@chlipala.net>
date Tue, 27 Jul 2010 11:42:30 -0400
parents
children
comparison
equal deleted inserted replaced
1279:4c367c8f5b2d 1280:3d06e0f7a6f3
1 type fruit = int
2 table fruit : { Id : fruit, Nam : string, Weight : float, Secret : string }
3 PRIMARY KEY Id,
4 CONSTRAINT Nam UNIQUE Nam
5
6 policy sendClient (SELECT fruit.Id, fruit.Nam
7 FROM fruit)
8
9 policy sendClient (SELECT fruit.Weight
10 FROM fruit
11 WHERE known(fruit.Secret))
12
13 policy equalKnown[#Secret] fruit
14
15 fun main () =
16 x1 <- queryX (SELECT fruit.Id, fruit.Nam, fruit.Weight
17 FROM fruit
18 WHERE fruit.Nam = "apple"
19 AND fruit.Secret = "tasty")
20 (fn x => <xml><li>{[x.Fruit.Id]}: {[x.Fruit.Nam]}, {[x.Fruit.Weight]}</li></xml>);
21
22 return <xml><body>
23 <ul>{x1}</ul>
24 </body></xml>