]> matita.cs.unibo.it Git - helm.git/commitdiff
mathql_interpreter.mysql_connection.* keys added.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 22 Apr 2004 15:00:11 +0000 (15:00 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 22 Apr 2004 15:00:11 +0000 (15:00 +0000)
helm/ocaml/mathql_interpreter/mQIMySql.ml

index e5cb01e4641f7489cabb48842a00062f11ea748c..4a68c93987a1c856af9c237ae938e20a7a76a3ed 100644 (file)
  *)
 
 let init () =
-   try Mysql.quick_connect
-       ~host:"mowgli.cs.unibo.it" ~database:"mowgli" ~user:"helm" ()
+ let module HR = Helm_registry in
+   let host =
+    HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.host" in
+   let database =
+    HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.database" in
+   let user =
+    HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.user" in
+   let port =
+    HR.get_opt HR.get_int "mathql_interpreter.mysql_connection.port" in
+   let password =
+    HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.password" in
+   try Mysql.quick_connect ?host ?database ?user ?port ?password ()
    with _ -> raise (Failure "mqi_connecion")
 
 let close c = Mysql.disconnect c