comparison sql.urs @ 6:799f43bce62b

Import some code from iwl
author Adam Chlipala <adam@chlipala.net>
date Tue, 14 Dec 2010 10:33:24 -0500
parents
children d05943db55e8
comparison
equal deleted inserted replaced
5:943410267fad 6:799f43bce62b
1 (** Common metaprogramming patterns for SQL syntax construction *)
2
3 val sqexps : env ::: {{Type}} -> fields ::: {Type} -> folder fields -> $(map sql_injectable fields)
4 -> $fields -> $(map (sql_exp env [] []) fields)
5 (* Convert a record of Ur values into a record of SQL expressions *)
6
7 val selector : tn :: Name -> fs ::: {Type} -> ofs ::: {Type} -> [fs ~ ofs]
8 => folder fs -> $(map sql_injectable fs) -> $fs
9 -> sql_exp [tn = ofs ++ fs] [] [] bool
10 (* Build a boolean SQL expression expressing equality of some fields of a table
11 * row with a record of Ur values *)