comparison tests/cst.ur @ 704:70cbdcf5989b

UNIQUE constraints
author Adam Chlipala <adamc@hcoop.net>
date Tue, 07 Apr 2009 12:24:31 -0400
parents
children e6706a1df013
comparison
equal deleted inserted replaced
703:a5d8b470d7ca 704:70cbdcf5989b
1 table t : {A : int, B : int}
2 CONSTRAINT UniA UNIQUE A,
3 CONSTRAINT UniB UNIQUE B,
4 CONSTRAINT UniBoth UNIQUE (A, B),
5
6 CONSTRAINT UniAm UNIQUE {#A},
7 CONSTRAINT UniAm2 UNIQUE {{[A = _]}},
8 CONSTRAINT UniAm3 {unique [[A = _]] !},
9 {{one_constraint [#UniAm4] (unique [[A = _]] !)}}
10
11 fun main () : transaction page =
12 queryI (SELECT * FROM t) (fn _ => return ());
13 return <xml/>