How to use syntax extension?

Hello, I am trying to run the first given example of the section “Using the PPX” of https://github.com/darioteixeira/pgocaml and.

I put the code in a file named test.ml running the following command,

ocamlfind ocamlc -package pgocaml test.ml

I get the following error:

Error: Uninterpreted extension ‘pgsql’

Am I missing something really trivial to make the syntax extension to work ?

I think the issue is the command you provided just includes the pgocaml library, but doesn’t run the ppx-rewriter.

The following command might be closer to be what you want:

ocamlfind ocamlc -package pgocaml -pp "ppxfind pgocaml_ppx" ./test.ml