Ppx_rapper is from my point of view a must have when using a database with OCaml and leveraging the strong typing feature of OCaml.
But it seems not to be supported anymore. Google doesn’t find its documentation, it doesn’t support Caqti2.0 (a pity, since Dream uses this version nowadays)… I also find Getting OCaml Through the Eye of a Needle where things are not so easy.
If it is not supported anymore, what would be the process to resurect it ?
I recently implemented a database connection using caqti last 2 weeks and wrote a blog about it.
Here it is, Modern PostgreSQL Connection Pooling in OCaml (2025): Caqti + Dream + Lwt
I would like to listen to your feedback or comments regarding my approach.
Cheers
Your blog mainly focus on pooling (an integrated function of the dream framework), and only expose a trivial SQL execution. (Caqti typically uses embedded typ2 or t2 function for types description)
ppx_rapper is complementary and is useful with complex query with many fields (input and output). See my Cookbook article SQLite CREATE, INSERT, SELECT using ppx_rapper_lwt - OCaml Cookbook or the official documentation GitHub - roddyyaga/ppx_rapper: Syntax extension for writing SQL in OCaml
It seems to be an opam publication issue.
opam serves a 3.1.0 version compatible with caqti 1… and the ppx_rapper Github repository serves a 3.1.0 version compatible with caqti 2…
1 Like
Hello Frederic.
Thank you for the clarification, I was not aware of the difference.
I am taking a look at the resource you sent.
Cheers