comparison src/settings.sml @ 868:06497beb265b

Moved dml code into Settings
author Adam Chlipala <adamc@hcoop.net>
date Sun, 28 Jun 2009 16:22:17 -0400
parents e7f80d78075b
children 64ba57fa20bf
comparison
equal deleted inserted replaced
867:e7f80d78075b 868:06497beb265b
319 -> Print.PD.pp_desc, 319 -> Print.PD.pp_desc,
320 queryPrepared : {loc : ErrorMsg.span, id : int, query : string, 320 queryPrepared : {loc : ErrorMsg.span, id : int, query : string,
321 inputs : sql_type list, numCols : int, 321 inputs : sql_type list, numCols : int,
322 doCols : ({wontLeakStrings : bool, col : int, typ : sql_type} -> Print.PD.pp_desc) 322 doCols : ({wontLeakStrings : bool, col : int, typ : sql_type} -> Print.PD.pp_desc)
323 -> Print.PD.pp_desc} 323 -> Print.PD.pp_desc}
324 -> Print.PD.pp_desc 324 -> Print.PD.pp_desc,
325 dml : ErrorMsg.span -> Print.PD.pp_desc,
326 dmlPrepared : {loc : ErrorMsg.span, id : int, dml : string,
327 inputs : sql_type list} -> Print.PD.pp_desc
325 } 328 }
326 329
327 val dbmses = ref ([] : dbms list) 330 val dbmses = ref ([] : dbms list)
328 val curDb = ref ({name = "", 331 val curDb = ref ({name = "",
329 header = "", 332 header = "",
330 link = "", 333 link = "",
331 global_init = Print.box [], 334 global_init = Print.box [],
332 init = fn _ => Print.box [], 335 init = fn _ => Print.box [],
333 query = fn _ => Print.box [], 336 query = fn _ => Print.box [],
334 queryPrepared = fn _ => Print.box []} : dbms) 337 queryPrepared = fn _ => Print.box [],
338 dml = fn _ => Print.box [],
339 dmlPrepared = fn _ => Print.box []} : dbms)
335 340
336 fun addDbms v = dbmses := v :: !dbmses 341 fun addDbms v = dbmses := v :: !dbmses
337 fun setDbms s = 342 fun setDbms s =
338 case List.find (fn db => #name db = s) (!dbmses) of 343 case List.find (fn db => #name db = s) (!dbmses) of
339 NONE => raise Fail ("Unknown DBMS " ^ s) 344 NONE => raise Fail ("Unknown DBMS " ^ s)