comparison demo/refFun.ur @ 708:1a317a707d71

Add primary keys to demo
author Adam Chlipala <adamc@hcoop.net>
date Tue, 07 Apr 2009 16:22:11 -0400
parents 7ef4b2911b09
children
comparison
equal deleted inserted replaced
707:d8217b4cb617 708:1a317a707d71
5 5
6 type ref = int 6 type ref = int
7 7
8 sequence s 8 sequence s
9 table t : { Id : int, Data : M.data } 9 table t : { Id : int, Data : M.data }
10 PRIMARY KEY Id
10 11
11 fun new d = 12 fun new d =
12 id <- nextval s; 13 id <- nextval s;
13 dml (INSERT INTO t (Id, Data) VALUES ({[id]}, {[d]})); 14 dml (INSERT INTO t (Id, Data) VALUES ({[id]}, {[d]}));
14 return id 15 return id