comparison lib/ur/basis.urs @ 704:70cbdcf5989b

UNIQUE constraints
author Adam Chlipala <adamc@hcoop.net>
date Tue, 07 Apr 2009 12:24:31 -0400
parents f963356b53fd
children e6706a1df013
comparison
equal deleted inserted replaced
703:a5d8b470d7ca 704:70cbdcf5989b
121 121
122 122
123 (** SQL *) 123 (** SQL *)
124 124
125 con sql_table :: {Type} -> Type 125 con sql_table :: {Type} -> Type
126
127 (*** Constraints *)
128
129 con sql_constraints :: {Unit} -> {Type} -> Type
130 con sql_constraint :: {Type} -> Type
131
132 val no_constraint : fs ::: {Type} -> sql_constraints [] fs
133 val one_constraint : fs ::: {Type} -> name :: Name -> sql_constraint fs -> sql_constraints [name] fs
134 val join_constraints : names1 ::: {Unit} -> names2 ::: {Unit} -> fs ::: {Type} -> [names1 ~ names2]
135 => sql_constraints names1 fs -> sql_constraints names2 fs
136 -> sql_constraints (names1 ++ names2) fs
137
138 val unique : rest ::: {Type} -> unique :: {Type} -> [unique ~ rest] => sql_constraint (unique ++ rest)
139
126 140
127 (*** Queries *) 141 (*** Queries *)
128 142
129 con sql_query :: {{Type}} -> {Type} -> Type 143 con sql_query :: {{Type}} -> {Type} -> Type
130 con sql_query1 :: {{Type}} -> {{Type}} -> {Type} -> Type 144 con sql_query1 :: {{Type}} -> {{Type}} -> {Type} -> Type