Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with Core causes 'The function applied to this argument has type ?sep:string -> string' #109

Open
gregberns opened this issue May 27, 2021 · 1 comment

Comments

@gregberns
Copy link

gregberns commented May 27, 2021

I'm new to OCaml and started using pgocaml but ran into an issue immediately because I used Core in the same module.

It was suggested I open an issue to see the problem could be mitigated in the library.

The issue is when I added Core and pgocaml's PPX in the same module, the compile fails.

With this code:

open Core
open PGOCaml
let () =
  let dbh = PGOCaml.connect () in
  let insert name salary =
    [%pgsql dbh "insert into employees (name, salary) VALUES ($name, $salary)"]
  in
  ignore(insert "Chris" 1_000.0);

When compiled:

File "bin/main.ml", line 20, characters 6-11:
20 |     [%pgsql dbh "insert into employees (name, salary) VALUES ($name, $salary)"]
           ^^^^^
Error: The function applied to this argument has type ?sep:string -> string
This argument cannot be applied without label

I'm pretty sure the issue is around here uses the String.concat with Core is not compatible.

@gregberns
Copy link
Author

Re-opening after editing/updating the initial issue.

@gregberns gregberns reopened this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant