comparison tests/policy.ur @ 1206:772760df4c4c

Parsing more of WHERE
author Adam Chlipala <adamc@hcoop.net>
date Sun, 04 Apr 2010 17:44:12 -0400
parents 7cd11380cdf1
children ae3036773768
comparison
equal deleted inserted replaced
1205:7cd11380cdf1 1206:772760df4c4c
10 10
11 policy query_policy (SELECT fruit.Id, fruit.Nam, fruit.Weight 11 policy query_policy (SELECT fruit.Id, fruit.Nam, fruit.Weight
12 FROM fruit) 12 FROM fruit)
13 policy query_policy (SELECT order.Id, order.Fruit, order.Qty 13 policy query_policy (SELECT order.Id, order.Fruit, order.Qty
14 FROM order, fruit 14 FROM order, fruit
15 WHERE order.Fruit = fruit.Id) 15 WHERE order.Fruit = fruit.Id
16 AND order.Qty = 13)
16 17
17 fun main () = 18 fun main () =
18 x1 <- queryX (SELECT fruit.Id, fruit.Nam 19 x1 <- queryX (SELECT fruit.Id, fruit.Nam
19 FROM fruit) 20 FROM fruit)
20 (fn x => <xml><li>{[x.Fruit.Id]}: {[x.Fruit.Nam]}</li></xml>); 21 (fn x => <xml><li>{[x.Fruit.Id]}: {[x.Fruit.Nam]}</li></xml>);
21 22
22 x2 <- queryX (SELECT fruit.Nam, order.Qty 23 x2 <- queryX (SELECT fruit.Nam, order.Qty
23 FROM fruit, order 24 FROM fruit, order
24 WHERE fruit.Id = order.Fruit) 25 WHERE fruit.Id = order.Fruit
26 AND order.Qty = 13)
25 (fn x => <xml><li>{[x.Fruit.Nam]}: {[x.Order.Qty]}</li></xml>); 27 (fn x => <xml><li>{[x.Fruit.Nam]}: {[x.Order.Qty]}</li></xml>);
26 28
27 return <xml><body> 29 return <xml><body>
28 <ul>{x1}</ul> 30 <ul>{x1}</ul>
29 <ul>{x2}</ul> 31 <ul>{x2}</ul>