summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-07 12:24:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-07 12:24:31 -0400
commite52d6c0bc6e2e911515d21c6acc1e311a8e30db9 (patch)
treeb422a6ade536f96b318a9d9547f2f2c95562691a /lib
parent69400f0524e8bcaa264eed203b8581992a4d1f7d (diff)
UNIQUE constraints
Diffstat (limited to 'lib')
-rw-r--r--lib/ur/basis.urs14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs
index 1cbca61d..dcf2a13d 100644
--- a/lib/ur/basis.urs
+++ b/lib/ur/basis.urs
@@ -124,6 +124,20 @@ val self : transaction client
con sql_table :: {Type} -> Type
+(*** Constraints *)
+
+con sql_constraints :: {Unit} -> {Type} -> Type
+con sql_constraint :: {Type} -> Type
+
+val no_constraint : fs ::: {Type} -> sql_constraints [] fs
+val one_constraint : fs ::: {Type} -> name :: Name -> sql_constraint fs -> sql_constraints [name] fs
+val join_constraints : names1 ::: {Unit} -> names2 ::: {Unit} -> fs ::: {Type} -> [names1 ~ names2]
+ => sql_constraints names1 fs -> sql_constraints names2 fs
+ -> sql_constraints (names1 ++ names2) fs
+
+val unique : rest ::: {Type} -> unique :: {Type} -> [unique ~ rest] => sql_constraint (unique ++ rest)
+
+
(*** Queries *)
con sql_query :: {{Type}} -> {Type} -> Type