-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
"in" filter cannot express strings containing commas #701
Comments
i would say |
That means breaking backwards compatibility- you would always have to specify the separator, because the current interpretation of that would be the strings
Right? |
no, both cases can still work, it's just an extension |
or just go with csv specs ... |
What I mean by breaking backwards compatibility is that you'd always have to specify the separator. By CSV specs do you mean for the escaping/quoting rules? |
Not 100% sure but i think there could be a function that can understand both formats at the same time. |
By CSV quoting do you mean just allowing double quotes in the query param like this? GET /names?name=in."x,y","a,b" Because if our parser could be made to handle that it seems like it would work fine. (Assuming double quotes are a valid url character, otherwise the client would have to urlencode it) |
Yes, that is what i mean |
oh that seems reasonable - that's actually the first thing I tried! |
PostgREST#641: allow IN filter to have no values (PostgREST#854)
Assume I have a relation "public.names", containing a single text column, "name".
I want to retrieve two names
"x,y"
and"a,b"
, using the in operator, so I make this request:This returns nothing, because
"x,y"
is parsed as two values. It seems there is no way to specify a stringcontaining a comma.
I have three ideas for solutions:
For 3, that could look something like this:
Personally, I feel like 3 is better - it could be a simple "filter DSL", which would have two frontends - the existing URL strings, and a JSON representation.
However, it might be nice to also have a patch for 2 simply allowing the separator for the "in" operator to be set via a header - it's much less work to implement and solves the immediate problem very quickly. I can probably implement this if needed!
Hopefully it's possible already and I wasted my time opening this issue though :-)
The text was updated successfully, but these errors were encountered: