diff src/postgres.sml @ 1011:16f7cb0891b6

Initial support for char in SQL
author Adam Chlipala <adamc@hcoop.net>
date Thu, 22 Oct 2009 16:15:56 -0400
parents 38a376dc7401
children ea9f03ac2710
line wrap: on
line diff
--- a/src/postgres.sml	Thu Oct 22 14:05:48 2009 -0400
+++ b/src/postgres.sml	Thu Oct 22 16:15:56 2009 -0400
@@ -39,6 +39,7 @@
         Int => "int8"
       | Float => "float8"
       | String => "text"
+      | Char => "char"
       | Bool => "bool"
       | Time => "timestamp"
       | Blob => "bytea"
@@ -51,6 +52,7 @@
         Int => "bigint"
       | Float => "double precision"
       | String => "text"
+      | Char => "character"
       | Bool => "boolean"
       | Time => "timestamp without time zone"
       | Blob => "bytea"
@@ -257,6 +259,8 @@
                        newline,
                        string "uw_sqlsuffixString = \"::text\";",
                        newline,
+                       string "uw_sqlsuffixChar = \"::char\";",
+                       newline,
                        string "uw_sqlsuffixBlob = \"::bytea\";",
                        newline,
                        string "uw_sqlfmtUint4 = \"%u::int4%n\";",
@@ -505,6 +509,7 @@
                     e
                 else
                     box [string "uw_strdup(ctx, ", e, string ")"]
+              | Char => box [e, string "[0]"]
               | Bool => box [string "uw_Basis_stringToBool_error(ctx, ", e, string ")"]
               | Time => box [string "uw_Basis_unsqlTime(ctx, ", e, string ")"]
               | Blob => box [string "uw_Basis_stringToBlob_error(ctx, ",
@@ -643,6 +648,7 @@
         Int => box [string "uw_Basis_attrifyInt(ctx, ", e, string ")"]
       | Float => box [string "uw_Basis_attrifyFloat(ctx, ", e, string ")"]
       | String => e
+      | Char => box [string "uw_Basis_attrifyChar(ctx, ", e, string ")"]
       | Bool => box [string "(", e, string " ? \"TRUE\" : \"FALSE\")"]
       | Time => box [string "uw_Basis_attrifyTime(ctx, ", e, string ")"]
       | Blob => box [e, string ".data"]