From 8dd241c403a9994376c3e1e0df4b255a012e0e98 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 17 Feb 2004 17:58:42 +0000 Subject: [PATCH] The PostgreSQL connection string has been moved to the Helm_registry (key mathql_interpreter.postgresql_connection_string). --- helm/ocaml/mathql_interpreter/mQIConn.ml | 9 +++++++-- helm/ocaml/mathql_interpreter/mQIMap.ml | 5 ++--- helm/ocaml/mathql_interpreter/mQIMap.mli | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/helm/ocaml/mathql_interpreter/mQIConn.ml b/helm/ocaml/mathql_interpreter/mQIConn.ml index 11dbd1674..460ef41d0 100644 --- a/helm/ocaml/mathql_interpreter/mQIConn.ml +++ b/helm/ocaml/mathql_interpreter/mQIConn.ml @@ -79,14 +79,19 @@ let flags_of_string s = string_fold_left (fun l c -> l @ flag_of_char c) [] s let init myflags mylog = - let s, m, a = + let m, a = let g = if List.mem Galax myflags then MQIMap.empty_map else MQIMap.read_map in g () in {log = mylog; set = myflags; - pgc = if List.mem Galax myflags then None else MQIPostgres.init s; + pgc = + if List.mem Galax myflags then + None + else + MQIPostgres.init + (Helm_registry.get "mathql_interpreter.postgresql_connection_string"); pgm = m; pga = a } diff --git a/helm/ocaml/mathql_interpreter/mQIMap.ml b/helm/ocaml/mathql_interpreter/mQIMap.ml index ed02524cc..b215f366f 100644 --- a/helm/ocaml/mathql_interpreter/mQIMap.ml +++ b/helm/ocaml/mathql_interpreter/mQIMap.ml @@ -34,12 +34,11 @@ type pg_tables = (bool * string) list type pg_alias = (string * string) list -let empty_map () = "", [], [] +let empty_map () = [], [] let read_map () = let map = Helm_registry.get "mathql_interpreter.db_map" in let ich = open_in map in - let pgs = input_line ich in let rec aux r s = let d = input_line ich in match Str.split (Str.regexp "[ \t]+") d with @@ -55,7 +54,7 @@ let read_map () = in let pgm, pga = aux [] [] in close_in ich; - pgs, pgm, pga + pgm, pga let comp c1 c2 = match c1, c2 with | (_, t1), (_, t2) when t1 < t2 -> U.Lt diff --git a/helm/ocaml/mathql_interpreter/mQIMap.mli b/helm/ocaml/mathql_interpreter/mQIMap.mli index bf78f6d62..50f5bb0fa 100644 --- a/helm/ocaml/mathql_interpreter/mQIMap.mli +++ b/helm/ocaml/mathql_interpreter/mQIMap.mli @@ -32,9 +32,9 @@ type pg_tables type pg_alias -val empty_map : unit -> string * pg_map * pg_alias +val empty_map : unit -> pg_map * pg_alias -val read_map : unit -> string * pg_map * pg_alias +val read_map : unit -> pg_map * pg_alias val get_tables : pg_map -> MathQL.path -> pg_tables -- 2.39.2