Add proper handling of null column values
[hcoop/smlsql.git] / sql_driver.sig
index 350b47e..5a6bc4e 100644 (file)
@@ -27,29 +27,32 @@ sig
     exception Sql of string
     (* All-purpose exception *)
 
+    type value
+    (* One value in a query result *)
+
     val conn : string -> conn
     (* Connect to a server based on a string of information *)
     val close : conn -> unit
     (* Close a connection *)
     val dml : conn -> string -> string
     (* Execute a DML command over a connection, returning a result message *)
-    val fold : conn -> (string list * 'a -> 'a) -> 'a -> string -> 'a
+    val fold : conn -> (value list * 'a -> 'a) -> 'a -> string -> 'a
     (* Behaves like List.foldl, applied over the result rows of a query *)
 
     type timestamp = Time.time
     exception Format of string
 
     (* Conversions between SML values and their string representations from SQL queries *)
-    val isNull : string -> bool
+    val isNull : value -> bool
     val intToSql : int -> string
-    val intFromSql : string -> int
+    val intFromSql : value -> int
     val stringToSql : string -> string
-    val stringFromSql : string -> string
+    val stringFromSql : value -> string
     val timestampToSql : timestamp -> string
     val timestampToSqlUnquoted : timestamp -> string
-    val timestampFromSql : string -> timestamp
+    val timestampFromSql : value -> timestamp
     val realToSql : real -> string
-    val realFromSql : string -> real
+    val realFromSql : value -> real
     val boolToSql : bool -> string
-    val boolFromSql : string -> bool
+    val boolFromSql : value -> bool
 end