I am using ocsgigen-start and I try to run following code with ppx PGOCaml syntax:
let%server () = Eliom_registration.Action.register ~service:post_info (fun () info -> let%lwt () = let dbh = PGOCaml.connect () in let get_lastname firstname = [%pgsql dbh "SELECT lastname FROM users WHERE firstname = $firstname"] in let firstname = "a" in Printf.printf "%s's lastname is %s\n" firstname (get_lastname firstname); PGOCaml.close(dbh) in Lwt.return () )
But unfortunately, pgsql syntax does not seem to be recognized during the build, as states:
File "demo_form.eliom", line 86, characters 13-18: Error: Uninterpreted extension 'pgsql'. Makefile.os:213: recipe for target '_server/demo_form.type_mli' failed make: *** [_server/demo_form.type_mli] Error 2
I find it strange because following line is included in Makefile.options:
SERVER_DB_PACKAGES := pgocaml pgocaml.ppx
How do you think I can fix it ?
Thanks a lot for your help