changeset 2144:f55b0e45422f

Fix .sql generation to honor 'noMangleSql' in column names
author Adam Chlipala <adam@chlipala.net>
date Sun, 10 May 2015 12:56:19 -0400
parents 4895c41b2ec6
children 5a010f408f36
files src/cjr_print.sml tests/nomangle.ur tests/nomangle.urp
diffstat 3 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/cjr_print.sml	Sun May 10 12:13:12 2015 -0400
+++ b/src/cjr_print.sml	Sun May 10 12:56:19 2015 -0400
@@ -3665,8 +3665,7 @@
                                                             let
                                                                 val t = sql_type_in env t
                                                             in
-                                                                box [string "uw_",
-                                                                     string (CharVector.map Char.toLower x),
+                                                                box [string (Settings.mangleSql (CharVector.map Char.toLower x)),
                                                                      space,
                                                                      string (#p_sql_type (Settings.currentDbms ()) t),
                                                                      case t of
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/nomangle.ur	Sun May 10 12:56:19 2015 -0400
@@ -0,0 +1,7 @@
+table foo : { Bar : int, Baz : string }
+  PRIMARY KEY Baz
+
+fun main () : transaction page =
+    rs <- queryX1 (SELECT foo.Bar FROM foo WHERE foo.Baz = 'Hi')
+          (fn r => <xml>{[r.Bar]}</xml>);
+    return <xml><body>{rs}</body></xml>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/nomangle.urp	Sun May 10 12:56:19 2015 -0400
@@ -0,0 +1,5 @@
+database dbname=test
+noMangleSql
+sql nomangle.sql
+
+nomangle