I am building an application that will need to persist data in a database. I need to query this database. I don’t mind either the ORM approach or the sql-query writing approach.
I saw a couple of options around, but I wanted to ask and see which option is more popular in the community.
Many of the ones I saw did not seem to be maintained, such as sequoia, ocamlodbc, ocamldbi
Many did not seem to have community backing or support / reviews, such as fun-sql and petrol
The only options I found to have some community support are:
- pgocaml: seems great, but a bit restrictive. Could not find a way to “compose” queries by building them from strings. More info in this open issue: Conditionally compose / build queries, avoiding repetition? · Issue #125 · darioteixeira/pgocaml · GitHub
- postgresql-ocaml: second option. Looks like what I need, but I could not find a “getting started” style documentation. the API docs is daunting when all I want to do is run some queries
- caqti: this seems to be the backend for many of the other libraries, so maybe it is not made to be used directly? I saw some talk about the approach of using it with
ppx-rapper
. but could not find more info about this approach.
So is there a more popular option in the community that I can find more guides or info about?