Anonymous avatar Anonymous committed 877237b

dbi_pg, sql_t, + `Void

Comments (0)

Files changed (1)

src/dbi/dbi_pg.ml

 type sql_t =
   [= sql_u
 
+  |  `Void
+
   |  `Bool of bool
   |  `Int of int      (* smallint *)
   |  `Int32 of int32  (* int, serial *)
     | P.BOOL -> `Bool
         (match x with
          [ "t" -> True | "f" -> False
-         | _ -> failwith "bad boolean" ])
+         | _ -> failwith "bad boolean"
+         ]
+        )
+    | P.VOID -> `Void
 
     | P.FLOAT8
     | P.INT2VECTOR
     | P.INTERNAL
     | P.LANGUAGE_HANDLER
     | P.TRIGGER
-    | P.VOID
     | P.ANYARRAY
     | P.ANY
     | P.CSTRING
 
 *)
 
-value detype_t v : sql_u =
+value detype_t (v : sql_t) : sql_u =
   match v with
   [ (`Binary _) | (`String _) | `Null
       as v -> v
     )
       -> `String x
 
+  | `Void ->
+      `String ""
+         (* http://comments.gmane.org/gmane.comp.db.postgresql.
+            devel.general/161403 *)
+
   | `Int64 i -> `String (Int64.to_string i)
   | `Int i -> `String (string_of_int i)
   | `Int32 i -> `String (Int32.to_string i)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.