comparison lib/basis.urs @ 305:55eedecb6c50

Remove need to mention table name in expressions for UPDATE and DELETE
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 14:30:32 -0400
parents 7204fab29486
children 99e4f39e820d
comparison
equal deleted inserted replaced
304:148ba06f3e67 305:55eedecb6c50
204 val dml : dml -> transaction unit 204 val dml : dml -> transaction unit
205 205
206 val insert : fields ::: {Type} 206 val insert : fields ::: {Type}
207 -> sql_table fields 207 -> sql_table fields
208 -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc => 208 -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc =>
209 [nm = sql_exp [T = fields] [] [] t] ++ acc) [] fields) 209 [nm = sql_exp [] [] [] t] ++ acc) [] fields)
210 -> dml 210 -> dml
211 211
212 val update : changed ::: {Type} -> unchanged ::: {Type} -> changed ~ unchanged 212 val update : changed :: {Type} -> unchanged ::: {Type} -> changed ~ unchanged
213 -> sql_table (changed ++ unchanged)
213 -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc => 214 -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc =>
214 [nm = sql_exp [T = changed ++ unchanged] [] [] t] ++ acc) [] changed) 215 [nm = sql_exp [] [] (changed ++ unchanged) t] ++ acc) [] changed)
215 -> sql_table (changed ++ unchanged) 216 -> sql_exp [] [] (changed ++ unchanged) bool
216 -> sql_exp [T = changed ++ unchanged] [] [] bool
217 -> dml 217 -> dml
218 218
219 val delete : fields ::: {Type} 219 val delete : fields ::: {Type}
220 -> sql_table fields 220 -> sql_table fields
221 -> sql_exp [T = fields] [] [] bool 221 -> sql_exp [] [] fields bool
222 -> dml 222 -> dml
223 223
224 224
225 (** XML *) 225 (** XML *)
226 226