diff tests/consub.ur @ 1887:2e6795cc992f

A fancier test for the new SQL constraints subtyping
author Adam Chlipala <adam@chlipala.net>
date Mon, 04 Nov 2013 16:00:48 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/consub.ur	Mon Nov 04 16:00:48 2013 -0500
@@ -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)