comparison lib/ur/basis.urs @ 748:5f9b9972e6b8

Switch to using sql_from_items
author Adam Chlipala <adamc@hcoop.net>
date Tue, 28 Apr 2009 09:45:17 -0400
parents 2c7244c066f1
children 16bfd9e244cd
comparison
equal deleted inserted replaced
747:e42f08f96eb5 748:5f9b9972e6b8
218 -> sql_subset 218 -> sql_subset
219 (map (fn fields :: ({Type} * {Type}) => fields.1 ++ fields.2) keep_drop) 219 (map (fn fields :: ({Type} * {Type}) => fields.1 ++ fields.2) keep_drop)
220 (map (fn fields :: ({Type} * {Type}) => fields.1) keep_drop) 220 (map (fn fields :: ({Type} * {Type}) => fields.1) keep_drop)
221 val sql_subset_all : tables :: {{Type}} -> sql_subset tables tables 221 val sql_subset_all : tables :: {{Type}} -> sql_subset tables tables
222 222
223 val sql_query1 : tables ::: {({Type} * {{Unit}})} 223 con sql_from_items :: {{Type}} -> Type
224
225 val sql_from_table : cols ::: {Type} -> keys ::: {{Unit}}
226 -> name :: Name -> sql_table cols keys
227 -> sql_from_items [name = cols]
228 val sql_from_comma : tabs1 ::: {{Type}} -> tabs2 ::: {{Type}}
229 -> [tabs1 ~ tabs2]
230 => sql_from_items tabs1 -> sql_from_items tabs2
231 -> sql_from_items (tabs1 ++ tabs2)
232
233 val sql_query1 : tables ::: {{Type}}
224 -> grouped ::: {{Type}} 234 -> grouped ::: {{Type}}
225 -> selectedFields ::: {{Type}} 235 -> selectedFields ::: {{Type}}
226 -> selectedExps ::: {Type} 236 -> selectedExps ::: {Type}
227 -> {From : $(map (fn p :: ({Type} * {{Unit}}) => sql_table p.1 p.2) tables), 237 -> {From : sql_from_items tables,
228 Where : sql_exp (map (fn p :: ({Type} * {{Unit}}) => p.1) tables) [] [] bool, 238 Where : sql_exp tables [] [] bool,
229 GroupBy : sql_subset (map (fn p :: ({Type} * {{Unit}}) => p.1) tables) grouped, 239 GroupBy : sql_subset tables grouped,
230 Having : sql_exp grouped (map (fn p :: ({Type} * {{Unit}}) => p.1) tables) [] bool, 240 Having : sql_exp grouped tables [] bool,
231 SelectFields : sql_subset grouped selectedFields, 241 SelectFields : sql_subset grouped selectedFields,
232 SelectExps : $(map (sql_exp grouped (map (fn p :: ({Type} * {{Unit}}) => p.1) tables) []) 242 SelectExps : $(map (sql_exp grouped tables [])
233 selectedExps) } 243 selectedExps) }
234 -> sql_query1 (map (fn p :: ({Type} * {{Unit}}) => p.1) tables) selectedFields selectedExps 244 -> sql_query1 tables selectedFields selectedExps
235 245
236 type sql_relop 246 type sql_relop
237 val sql_union : sql_relop 247 val sql_union : sql_relop
238 val sql_intersect : sql_relop 248 val sql_intersect : sql_relop
239 val sql_except : sql_relop 249 val sql_except : sql_relop