diff options
-rw-r--r-- | src/cjr_print.sml | 2 | ||||
-rw-r--r-- | src/mysql.sml | 7 | ||||
-rw-r--r-- | src/postgres.sml | 3 | ||||
-rw-r--r-- | src/settings.sig | 3 | ||||
-rw-r--r-- | src/settings.sml | 6 |
5 files changed, 14 insertions, 7 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml index 6dc3a83c..4121bf5e 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2844,7 +2844,7 @@ fun p_sql env (ds, _) = end) env ds in - box pps + box (string (#sqlPrefix (Settings.currentDbms ())) :: pps) end end diff --git a/src/mysql.sml b/src/mysql.sml index eef05a6a..65e62588 100644 --- a/src/mysql.sml +++ b/src/mysql.sml @@ -487,7 +487,9 @@ fun init {dbstring, prepared = ss, tables, views, sequences} = 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 @@ val () = addDbms {name = "mysql", 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 diff --git a/src/postgres.sml b/src/postgres.sml index 163bc0b8..a178f086 100644 --- a/src/postgres.sml +++ b/src/postgres.sml @@ -893,7 +893,8 @@ val () = addDbms {name = "postgres", createSequence = fn s => "CREATE SEQUENCE " ^ s, textKeysNeedLengths = false, supportsNextval = true, - supportsNestedPrepared = true} + supportsNestedPrepared = true, + sqlPrefix = ""} val () = setDbms "postgres" diff --git a/src/settings.sig b/src/settings.sig index f6b005b9..92dbbab9 100644 --- a/src/settings.sig +++ b/src/settings.sig @@ -153,7 +153,8 @@ signature SETTINGS = sig createSequence : string -> string, textKeysNeedLengths : bool, supportsNextval : bool, - supportsNestedPrepared : bool + supportsNestedPrepared : bool, + sqlPrefix : string } val addDbms : dbms -> unit diff --git a/src/settings.sml b/src/settings.sml index d47e7d0e..d1901483 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -343,7 +343,8 @@ type dbms = { createSequence : string -> string, textKeysNeedLengths : bool, supportsNextval : bool, - supportsNestedPrepared : bool + supportsNestedPrepared : bool, + sqlPrefix : string } val dbmses = ref ([] : dbms list) @@ -365,7 +366,8 @@ val curDb = ref ({name = "", createSequence = fn _ => "", textKeysNeedLengths = false, supportsNextval = false, - supportsNestedPrepared = false} : dbms) + supportsNestedPrepared = false, + sqlPrefix = ""} : dbms) fun addDbms v = dbmses := v :: !dbmses fun setDbms s = |