Skip to content

WhereRaw not raw enough #215

@joshcobalt

Description

@joshcobalt

This is something that I don't believe can currently be accomplished because of lack of flexibility in the API.

This generates three separate parameters, which will not work.
query.WhereRaw("some_column = ANY(?)", new int[] { 1, 2, 3 });

What's needed is:
"where some_column = ANY('{1,2,3}')"

So if I try the query again, passing the param as a string and then casting it in postgresql:
query.WhereRaw("some_column = ANY(?::int[])","{1, 2, 3 }");

My [] characters get converted to "quotes".
where some_column = ANY('{1,2,3}'::int"""")

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