Skip to content

Query errors out with JSONB operators #30

@nitinprakash96

Description

@nitinprakash96

A couple of JSONB operators like ?| and ?& don't play nice with the library.
Notice how they seem to be interpreted as named parameters in the first query.

-- @?|@ is probably being interpreted as a named parameter
> extractNames "SELECT foo FROM my_table WHERE (foo->'mood'->'tag_keys' ?| ?selectedTags);"
Left PostgreSQL named parameter error: Query contains an empty name: SELECT  foo FROM my_table WHERE (foo->'mood'->'tag_keys' ?| ?selectedTags);
>
-- @> works perfectly fine.Not that this query itself is correct. 
-- Just using it to enable some contrast with the above
> extractNames "SELECT foo FROM my_table WHERE (foo->'mood'->'tag_keys' @> ?selectedTags);"
Right ("SELECT foo FROM my_table WHERE (foo->'mood'->'tag_keys' @> ?);","selectedTags" :| [])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions