-let init myflags mylog =
- {log = mylog; set = myflags;
- pgc = if List.mem Galax myflags
- then None else MQIPostgres.init ()
+let init ?(flags = []) ?(log = ignore) () =
+ let flags =
+ if flags = [] then
+ flags_of_string (Helm_registry.get "mathql_interpreter.flags")
+ else
+ flags
+ in
+ let m, a =
+ let g =
+ if List.mem Galax flags
+ then MQIMap.empty_map else MQIMap.read_map
+ in g ()
+ in
+ {log = log; set = flags;
+ pgc = begin
+ try
+ if List.mem Galax flags then No_C else
+ if List.mem Postgres flags then Postgres_C (MQIPostgres.init ()) else
+ MySQL_C (MQIMySql.init ())
+ with Failure "mqi_connection" -> No_C
+ end;
+ pgm = m; pga = a