comparison src/settings.sml @ 866:03e7f111fe99

Start of multi-DBMS support
author Adam Chlipala <adamc@hcoop.net>
date Sun, 28 Jun 2009 13:49:32 -0400
parents ebefb0609ac3
children e7f80d78075b
comparison
equal deleted inserted replaced
865:ebefb0609ac3 866:03e7f111fe99
272 272
273 val debug = ref false 273 val debug = ref false
274 fun setDebug b = debug := b 274 fun setDebug b = debug := b
275 fun getDebug () = !debug 275 fun getDebug () = !debug
276 276
277 type dbms = {
278 name : string,
279 header : string,
280 link : string,
281 global_init : Print.PD.pp_desc,
282 init : string * (string * int) list -> Print.PD.pp_desc
283 }
284
285 val dbmses = ref ([] : dbms list)
286 val curDb = ref ({name = "",
287 header = "",
288 link = "",
289 global_init = Print.box [],
290 init = fn _ => Print.box []} : dbms)
291
292 fun addDbms v = dbmses := v :: !dbmses
293 fun setDbms s =
294 case List.find (fn db => #name db = s) (!dbmses) of
295 NONE => raise Fail ("Unknown DBMS " ^ s)
296 | SOME db => curDb := db
297 fun currentDbms () = !curDb
298
277 end 299 end