I am intended to build with dune this small piece of code:
open Os_db include Type let post_wish user_id wish = full_transaction_block (fun dbh -> [%pgsql dbh "UPDATE ocsigen_start.wishes SET info = (info || jsonb_build_object($wish :: text, $wish :: text))"])
little experienced with compiling with ppx, I do not succeed writing properly the dune file. Here is my dune file:
(library (name administrative_book) (libraries type pgocaml pgocaml.ppx ocsigen-start.server) (preprocess (pps ppx_deriving.std pgocaml pgocaml.ppx)))
Here is error message I get when building above library:
$ dune build administrative_book/administrative_book.a File "administrative_book/administrative_book.ml", line 6, characters 6-11: Error: Uninterpreted extension 'pgsql'.
I am using pgocaml version 3.2 (that is why I have to write pgocaml.ppx instead of pgocaml_ppx).
I have been searching ocsigen makefile where are written rules to compile such files, I tried several combinations but I could not make it work. Here are packages referenced for compilation of such files inside ocsigen makefile, as an important hint I think:
SERVER_ELIOM_PACKAGES := ocsigen-start.server SERVER_PACKAGES := lwt_ppx js_of_ocaml-ppx.deriving ppx_deriving.std pgocaml SERVER_DB_PACKAGES := pgocaml pgocaml.ppx
Thank you a lot for your help