changeset 882:9c1b7e46eed2

MySQL CGI working
author Adam Chlipala <adamc@hcoop.net>
date Fri, 17 Jul 2009 12:58:37 -0400
parents 45a63416adb4
children 467285bb5578
files src/cjr_print.sml src/mysql.sml src/postgres.sml src/settings.sig src/settings.sml
diffstat 5 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/cjr_print.sml	Fri Jul 17 12:34:00 2009 -0400
+++ b/src/cjr_print.sml	Fri Jul 17 12:58:37 2009 -0400
@@ -2844,7 +2844,7 @@
                            end)
                        env ds
     in
-        box pps
+        box (string (#sqlPrefix (Settings.currentDbms ())) :: pps)
     end
 
 end
--- a/src/mysql.sml	Fri Jul 17 12:34:00 2009 -0400
+++ b/src/mysql.sml	Fri Jul 17 12:58:37 2009 -0400
@@ -487,7 +487,9 @@
 
                       string "}"]
              else
-                 string "static void uw_db_prepare(uw_context ctx) { }",
+                 box [string "static void uw_db_prepare(uw_context ctx) { }",
+                      newline,
+                      string "static void uw_db_validate(uw_context ctx) { }"],
              newline,
              newline,
              
@@ -1445,6 +1447,7 @@
                   createSequence = fn s => "CREATE TABLE " ^ s ^ " (id INTEGER PRIMARY KEY AUTO_INCREMENT)",
                   textKeysNeedLengths = true,
                   supportsNextval = false,
-                  supportsNestedPrepared = false}
+                  supportsNestedPrepared = false,
+                  sqlPrefix = "SET storage_engine=InnoDB;\n"}
 
 end
--- a/src/postgres.sml	Fri Jul 17 12:34:00 2009 -0400
+++ b/src/postgres.sml	Fri Jul 17 12:58:37 2009 -0400
@@ -893,7 +893,8 @@
                   createSequence = fn s => "CREATE SEQUENCE " ^ s,
                   textKeysNeedLengths = false,
                   supportsNextval = true,
-                  supportsNestedPrepared = true}
+                  supportsNestedPrepared = true,
+                  sqlPrefix = ""}
 
 val () = setDbms "postgres"
 
--- a/src/settings.sig	Fri Jul 17 12:34:00 2009 -0400
+++ b/src/settings.sig	Fri Jul 17 12:58:37 2009 -0400
@@ -153,7 +153,8 @@
          createSequence : string -> string,
          textKeysNeedLengths : bool,
          supportsNextval : bool,
-         supportsNestedPrepared : bool
+         supportsNestedPrepared : bool,
+         sqlPrefix : string
     }
 
     val addDbms : dbms -> unit
--- a/src/settings.sml	Fri Jul 17 12:34:00 2009 -0400
+++ b/src/settings.sml	Fri Jul 17 12:58:37 2009 -0400
@@ -343,7 +343,8 @@
      createSequence : string -> string,
      textKeysNeedLengths : bool,
      supportsNextval : bool,
-     supportsNestedPrepared : bool
+     supportsNestedPrepared : bool,
+     sqlPrefix : string
 }
 
 val dbmses = ref ([] : dbms list)
@@ -365,7 +366,8 @@
                   createSequence = fn _ => "",
                   textKeysNeedLengths = false,
                   supportsNextval = false,
-                  supportsNestedPrepared = false} : dbms)
+                  supportsNestedPrepared = false,
+                  sqlPrefix = ""} : dbms)
 
 fun addDbms v = dbmses := v :: !dbmses
 fun setDbms s =