summaryrefslogtreecommitdiff
path: root/tests/consub.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2013-11-04 16:00:48 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2013-11-04 16:00:48 -0500
commit101b52b8fd4283c34f731300436ed19cf47dc6fa (patch)
tree02e9fe94d53d44b645dd88a2cf10680bb16213a8 /tests/consub.ur
parentd6d59fcdb5697d58de452a811ce69ee0f8563489 (diff)
A fancier test for the new SQL constraints subtyping
Diffstat (limited to 'tests/consub.ur')
-rw-r--r--tests/consub.ur16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/consub.ur b/tests/consub.ur
new file mode 100644
index 00000000..4656e335
--- /dev/null
+++ b/tests/consub.ur
@@ -0,0 +1,16 @@
+functor F(M : sig
+ table t : { A : int, B : int }
+ PRIMARY KEY A
+ end) = struct
+ open M
+
+ fun getByA a = oneRow1 (SELECT * FROM t WHERE t.A = {[a]})
+end
+
+table u : { A : int, B : int }
+ PRIMARY KEY A,
+ CONSTRAINT B UNIQUE B
+
+open F(struct
+ val t = u
+ end)