-let db = Postgres.Connection.connect "dbname=mowgli user=helm host=mowgli.cs.unibo.it"
+module PG = Postgres
-let _ =
- let status =
- match Postgres.Connection.status db with
- Postgres.Connection.Ok -> "ok"
- | _ -> "bad"
- in
- Printf.printf "connection status is %s\n" status ;
- flush stdout
+let db =
+ try
+ new PG.connection "dbname='mowgli_test' user='helm' host='mowgli.cs.unibo.it'"
+ with
+ PG.Error e as exc ->
+ prerr_endline (PG.string_of_error e) ;
+ raise exc
-let res = Postgres.Connection.exec db "SELECT * FROM refObj WHERE source = 'cic:/Coq/Arith/Le/le_O_n.con';"
+let res = db#exec "SELECT * FROM refObj WHERE source = 'cic:/Coq/Arith/Le/le_O_n.con';"
let _ =
- Printf.printf "# results: %d\n" (Postgres.Result.ntuples res) ;
+ Printf.printf "# results: %d\n" (res#ntuples) ;
flush stdout