comparison lib/ur/basis.urs @ 753:d484df4e841a

Preparing to allow views in SELECT FROM clauses
author Adam Chlipala <adamc@hcoop.net>
date Tue, 28 Apr 2009 14:02:23 -0400
parents f95d652086cd
children 8ce31c052dce
comparison
equal deleted inserted replaced
752:bc5cfd6cb30f 753:d484df4e841a
122 122
123 123
124 (** SQL *) 124 (** SQL *)
125 125
126 con sql_table :: {Type} -> {{Unit}} -> Type 126 con sql_table :: {Type} -> {{Unit}} -> Type
127 con sql_view :: {Type} -> Type
128
129 class fieldsOf :: Type -> {Type} -> Type
130 val fieldsOf_table : fs ::: {Type} -> keys ::: {{Unit}}
131 -> fieldsOf (sql_table fs keys) fs
132 val fieldsOf_view : fs ::: {Type}
133 -> fieldsOf (sql_view fs) fs
127 134
128 (*** Constraints *) 135 (*** Constraints *)
129 136
130 (**** Primary keys *) 137 (**** Primary keys *)
131 138
220 (map (fn fields :: ({Type} * {Type}) => fields.1) keep_drop) 227 (map (fn fields :: ({Type} * {Type}) => fields.1) keep_drop)
221 val sql_subset_all : tables :: {{Type}} -> sql_subset tables tables 228 val sql_subset_all : tables :: {{Type}} -> sql_subset tables tables
222 229
223 con sql_from_items :: {{Type}} -> Type 230 con sql_from_items :: {{Type}} -> Type
224 231
225 val sql_from_table : cols ::: {Type} -> keys ::: {{Unit}} 232 val sql_from_table : t ::: Type -> fs ::: {Type}
226 -> name :: Name -> sql_table cols keys 233 -> fieldsOf t fs -> name :: Name
227 -> sql_from_items [name = cols] 234 -> t -> sql_from_items [name = fs]
228 val sql_from_comma : tabs1 ::: {{Type}} -> tabs2 ::: {{Type}} 235 val sql_from_comma : tabs1 ::: {{Type}} -> tabs2 ::: {{Type}}
229 -> [tabs1 ~ tabs2] 236 -> [tabs1 ~ tabs2]
230 => sql_from_items tabs1 -> sql_from_items tabs2 237 => sql_from_items tabs1 -> sql_from_items tabs2
231 -> sql_from_items (tabs1 ++ tabs2) 238 -> sql_from_items (tabs1 ++ tabs2)
232 val sql_inner_join : tabs1 ::: {{Type}} -> tabs2 ::: {{Type}} 239 val sql_inner_join : tabs1 ::: {{Type}} -> tabs2 ::: {{Type}}