diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-11-06 18:49:38 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-11-06 18:49:38 -0500 |
commit | 3af6c283c504e7e85d9e127f64a5eb72abe583ee (patch) | |
tree | 89c4891d29fe4c10e81ed23ad7747b2a7d115064 /lib/top.ur | |
parent | 98d669cf07157e275fa796fdd5ad35f3388b0ad1 (diff) |
Tree demo works
Diffstat (limited to 'lib/top.ur')
-rw-r--r-- | lib/top.ur | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -226,3 +226,16 @@ fun oneRow (tables ::: {{Type}}) (exps ::: {Type}) None => error <xml>Query returned no rows</xml> | Some r => r) +fun eqNullable (tables ::: {{Type}}) (agg ::: {{Type}}) (exps ::: {Type}) + (t ::: Type) (_ : sql_injectable (option t)) + (e1 : sql_exp tables agg exps (option t)) + (e2 : sql_exp tables agg exps (option t)) = + (SQL ({[e1]} IS NULL AND {[e2]} IS NULL) OR {[e1]} = {[e2]}) + +fun eqNullable' (tables ::: {{Type}}) (agg ::: {{Type}}) (exps ::: {Type}) + (t ::: Type) (inj : sql_injectable (option t)) + (e1 : sql_exp tables agg exps (option t)) + (e2 : option t) = + case e2 of + None => (SQL {[e1]} IS NULL) + | Some _ => sql_comparison sql_eq e1 (@sql_inject inj e2) |