diff lib/ur/top.ur @ 1074:d89f98f0b4bb

Fixing a bug in DInitializer elaboration
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Dec 2009 14:34:18 -0500
parents 9001966ae1c8
children dcf98ae3c48d
line wrap: on
line diff
--- a/lib/ur/top.ur	Sun Dec 13 14:20:41 2009 -0500
+++ b/lib/ur/top.ur	Sun Dec 13 14:34:18 2009 -0500
@@ -271,6 +271,9 @@
                 None => error <xml>Query returned no rows</xml>
               | Some r => r.nm)
 
+fun nonempty [fs] [us] (t : sql_table fs us) =
+    oneRowE1 (SELECT COUNT( * ) > 0 AS B FROM t)
+
 fun eqNullable [tables ::: {{Type}}] [agg ::: {{Type}}] [exps ::: {Type}]
     [t ::: Type] (_ : sql_injectable (option t))
     (e1 : sql_exp tables agg exps (option t))