Mercurial > meta
annotate sql.urs @ 12:a6730c3cfea7
Record.equal
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 08 Feb 2011 16:52:41 -0500 |
parents | 799f43bce62b |
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 *) |