diff src/settings.sig @ 867:e7f80d78075b

Moved query code into Settings
author Adam Chlipala <adamc@hcoop.net>
date Sun, 28 Jun 2009 16:03:00 -0400
parents 03e7f111fe99
children 06497beb265b
line wrap: on
line diff
--- a/src/settings.sig	Sun Jun 28 13:49:32 2009 -0400
+++ b/src/settings.sig	Sun Jun 28 16:03:00 2009 -0400
@@ -101,6 +101,20 @@
     val currentProtocol : unit -> protocol
 
     (* Different DBMSes *)
+    datatype sql_type =
+             Int
+           | Float
+           | String
+           | Bool
+           | Time
+           | Blob
+           | Channel
+           | Client
+           | Nullable of sql_type
+
+    val p_sql_type : sql_type -> Print.PD.pp_desc
+    val isBlob : sql_type -> bool
+
     type dbms = {
          name : string,
          (* Call it this on the command line *)
@@ -110,8 +124,18 @@
          (* Pass these linker arguments *)
          global_init : Print.PD.pp_desc,
          (* Define uw_client_init() *)
-         init : string * (string * int) list -> Print.PD.pp_desc
-         (* Define uw_db_init() from dbstring and prepared statements *)
+         init : string * (string * int) list -> Print.PD.pp_desc,
+         (* Define uw_db_init(), uw_db_close(), uw_db_begin(), uw_db_commit(), and uw_db_rollback()
+          * from dbstring and prepared statements *)
+         query : {loc : ErrorMsg.span, numCols : int,
+                  doCols : ({wontLeakStrings : bool, col : int, typ : sql_type} -> Print.PD.pp_desc)
+                           -> Print.PD.pp_desc}
+                 -> Print.PD.pp_desc,
+         queryPrepared : {loc : ErrorMsg.span, id : int, query : string,
+                          inputs : sql_type list, numCols : int,
+                          doCols : ({wontLeakStrings : bool, col : int, typ : sql_type} -> Print.PD.pp_desc)
+                                   -> Print.PD.pp_desc}
+                         -> Print.PD.pp_desc
     }
 
     val addDbms : dbms -> unit