comparison src/settings.sml @ 1953:0992323fa264

noMangleSql .urp directive
author Adam Chlipala <adam@chlipala.net>
date Sat, 04 Jan 2014 19:02:14 -0500
parents cf7f7e51b0a2
children ac1be85e91ad
comparison
equal deleted inserted replaced
1952:cf7f7e51b0a2 1953:0992323fa264
694 694
695 val timeFormat = ref "%c" 695 val timeFormat = ref "%c"
696 fun setTimeFormat v = timeFormat := v 696 fun setTimeFormat v = timeFormat := v
697 fun getTimeFormat () = !timeFormat 697 fun getTimeFormat () = !timeFormat
698 698
699 fun lowercase s =
700 case s of
701 "" => ""
702 | _ => str (Char.toLower (String.sub (s, 0))) ^ String.extract (s, 1, NONE)
703
704 fun capitalize s =
705 case s of
706 "" => ""
707 | _ => str (Char.toUpper (String.sub (s, 0))) ^ String.extract (s, 1, NONE)
708
709 val mangle = ref true
710 fun setMangleSql x = mangle := x
711 fun mangleSqlTable s = if !mangle then "uw_" ^ capitalize s
712 else if #name (currentDbms ()) = "mysql" then capitalize s
713 else "\"" ^ lowercase s ^ "\""
714 fun mangleSql s = if !mangle then "uw_" ^ s
715 else if #name (currentDbms ()) = "mysql" then lowercase s
716 else "\"" ^ lowercase s ^ "\""
717 fun mangleSqlCatalog s = if !mangle then "uw_" ^ s else lowercase s
718
699 end 719 end