diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-07 12:24:31 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-07 12:24:31 -0400 |
commit | e52d6c0bc6e2e911515d21c6acc1e311a8e30db9 (patch) | |
tree | b422a6ade536f96b318a9d9547f2f2c95562691a /tests | |
parent | 69400f0524e8bcaa264eed203b8581992a4d1f7d (diff) |
UNIQUE constraints
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cst.ur | 13 | ||||
-rw-r--r-- | tests/cst.urp | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/cst.ur b/tests/cst.ur new file mode 100644 index 00000000..104a9f34 --- /dev/null +++ b/tests/cst.ur @@ -0,0 +1,13 @@ +table t : {A : int, B : int} + CONSTRAINT UniA UNIQUE A, + CONSTRAINT UniB UNIQUE B, + CONSTRAINT UniBoth UNIQUE (A, B), + + CONSTRAINT UniAm UNIQUE {#A}, + CONSTRAINT UniAm2 UNIQUE {{[A = _]}}, + CONSTRAINT UniAm3 {unique [[A = _]] !}, + {{one_constraint [#UniAm4] (unique [[A = _]] !)}} + +fun main () : transaction page = + queryI (SELECT * FROM t) (fn _ => return ()); + return <xml/> diff --git a/tests/cst.urp b/tests/cst.urp new file mode 100644 index 00000000..b9deaa44 --- /dev/null +++ b/tests/cst.urp @@ -0,0 +1,5 @@ +debug +database dbname=cst +sql cst.sql + +cst |