postgresql-simple icon indicating copy to clipboard operation
postgresql-simple copied to clipboard

JSON question mark operators don't work

Open Vlix opened this issue 7 years ago • 1 comments

When trying to use the new (since PostgreSQL 9.4) operators on jsonb that contain question marks, the package incorrectly assumes they are parameters to be replaced with values by Database.PostgreSQL.Simple.buildQuery.

I propose a change to buildQuery that escapes ?? to ? without trying to count it as a to be replaced parameter. This is a very common method of escaping question marks in prepared statements afaik. I also don't expect anything breaking after this change, but if anyone knows of an instance this change may break something, do tell.

I can make a pull request if desired.

Vlix avatar Mar 01 '18 11:03 Vlix

I've made the pull request and updated it to include tests for the new jsonb operators

Vlix avatar Jun 28 '18 20:06 Vlix