diff lib/basis.lig @ 209:1487c712eb12

Stub WHERE support
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 Aug 2008 12:15:38 -0400
parents cc68da3801bc
children 38b299373676
line wrap: on
line diff
--- a/lib/basis.lig	Sat Aug 16 10:54:46 2008 -0400
+++ b/lib/basis.lig	Sat Aug 16 12:15:38 2008 -0400
@@ -14,14 +14,26 @@
 (*** Queries *)
 
 con sql_query :: {{Type}} -> Type
+con sql_exp :: {{Type}} -> Type -> Type
 
 val sql_query : tables :: {({Type} * {Type})}
-        -> $(fold (fn nm => fn selected_unselected :: ({Type} * {Type}) => fn acc =>
+        -> {From : $(fold (fn nm => fn selected_unselected :: ({Type} * {Type}) => fn acc =>
                 [nm] ~ acc => selected_unselected.1 ~ selected_unselected.2 =>
-                [nm = sql_table (selected_unselected.1 ++ selected_unselected.2)] ++ acc) [] tables)
+                [nm = sql_table (selected_unselected.1 ++ selected_unselected.2)] ++ acc) [] tables),
+            Where : sql_exp (fold (fn nm => fn selected_unselected :: ({Type} * {Type}) => fn acc =>
+                [nm] ~ acc => selected_unselected.1 ~ selected_unselected.2 =>
+                [nm = selected_unselected.1 ++ selected_unselected.2] ++ acc) [] tables) bool}
         -> sql_query (fold (fn nm => fn selected_unselected :: ({Type} * {Type}) => fn acc => [nm] ~ acc =>
                 [nm = selected_unselected.1] ++ acc) [] tables)
 
+con sql_type :: Type -> Type
+val sql_bool : sql_type bool
+val sql_int : sql_type int
+val sql_float : sql_type float
+val sql_string : sql_type string
+
+val sql_inject : tables ::: {{Type}} -> t ::: Type -> t -> sql_type t -> sql_exp tables t
+
 
 (** XML *)