annotate 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
rev   line source
adam@6 1 (** Common metaprogramming patterns for SQL syntax construction *)
adam@6 2
adam@6 3 val sqexps : env ::: {{Type}} -> fields ::: {Type} -> folder fields -> $(map sql_injectable fields)
adam@6 4 -> $fields -> $(map (sql_exp env [] []) fields)
adam@6 5 (* Convert a record of Ur values into a record of SQL expressions *)
adam@6 6
adam@6 7 val selector : tn :: Name -> fs ::: {Type} -> ofs ::: {Type} -> [fs ~ ofs]
adam@6 8 => folder fs -> $(map sql_injectable fs) -> $fs
adam@6 9 -> sql_exp [tn = ofs ++ fs] [] [] bool
adam@6 10 (* Build a boolean SQL expression expressing equality of some fields of a table
adam@6 11 * row with a record of Ur values *)