adamc@1236: type fruit = int
adamc@1236: table fruit : { Id : fruit, Nam : string, Weight : float, Secret : string }
adamc@1236: PRIMARY KEY Id,
adamc@1236: CONSTRAINT Nam UNIQUE Nam
adamc@1236:
adamc@1236: (* Everyone may knows IDs and names. *)
adamc@1236: policy sendClient (SELECT fruit.Id, fruit.Nam
adamc@1236: FROM fruit)
adamc@1236:
adamc@1236: (* The weight is sensitive information; you must know the secret. *)
adamc@1236: policy sendClient (SELECT fruit.Weight, fruit.Secret
adamc@1236: FROM fruit
adamc@1236: WHERE known(fruit.Secret))
adamc@1236:
adamc@1236: fun main () =
adamc@1236: x1 <- queryX (SELECT fruit.Id, fruit.Nam
adamc@1236: FROM fruit
adamc@1236: WHERE fruit.Nam = "apple")
adamc@1236: (fn x => {[x.Fruit.Id]}: {[x.Fruit.Nam]});
adamc@1236: return
adamc@1236:
adamc@1236: