annotate 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
rev   line source
adamc@704 1 table t : {A : int, B : int}
adamc@704 2 CONSTRAINT UniA UNIQUE A,
adamc@704 3 CONSTRAINT UniB UNIQUE B,
adamc@704 4 CONSTRAINT UniBoth UNIQUE (A, B),
adamc@704 5
adamc@704 6 CONSTRAINT UniAm UNIQUE {#A},
adamc@704 7 CONSTRAINT UniAm2 UNIQUE {{[A = _]}},
adamc@704 8 CONSTRAINT UniAm3 {unique [[A = _]] !},
adamc@704 9 {{one_constraint [#UniAm4] (unique [[A = _]] !)}}
adamc@704 10
adamc@704 11 fun main () : transaction page =
adamc@704 12 queryI (SELECT * FROM t) (fn _ => return ());
adamc@704 13 return <xml/>