Hi,
I'm trying to find a lib to access a DB from an Ocaml program. After trying ocaml-sqlite, I'm not satisfied since it's somewhat slow.
I've seen a mysql module but it doesn't seem to be maintained.
thanks.
Hi,
I'm trying to find a lib to access a DB from an Ocaml program. After trying ocaml-sqlite, I'm not satisfied since it's somewhat slow.
I've seen a mysql module but it doesn't seem to be maintained.
thanks.
Have you checked the Caml Hump? It has links to plenty of database bindings.
Good, mature, bindings that I can recommend are PG'OCaml by Richard Jones and postgresql-ocaml by Markus Mottl. They are both targeted at Postgresql (which is a probably a better choice for you considering you're into Ocaml).
I'm quite surprised that you find the ocaml-sqlite bindings slow. sqlite is fast on its own, and I believe the sqlite bindings are very well written. You should make sure you're using the up-to-date binding from Markus Mottl's page
ocaml-mysql works without problems here - mysql api for connect/query/fetch doesn't change that much :) It lacks prepared statements though, had to implement mysql_stmt_* wrappers myself.