-
Notifications
You must be signed in to change notification settings - Fork 56
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
Hasql.Encoders allows encoding an "array of unknown", which doesn't (can't?) work #147
Comments
I don't remember precisely why it was decided to make I would replace that encoder with a binary one, but I sense that you're not the only people who have already applied it in practice. I have another idea of what can be done about it to make it safe though. If we move it from the level of What do you guys think of all this? |
It seems reasonable to me that From my point of view, trying to deal with the large JSON bodies in Postgrest, it's a bit hard to ask for changes specifically for I'm not sure I understand your |
unknown
encodes as postgres protocolText
format, while everything else encodes toBinary
format. But this generates an invalid mix ofText
andBinary
, whenunknown
values occur in arrays. E.g. the following test case fails (not that it necessarily should pass, but maybe it should fail to type check?):Not sure this is a big deal -- might be sufficient to document this as unsensible for the
unknown
docs? Another thought I had was to parametrizeValue
withLibPQ.Format
, along the lines of(Context: This came out of experimenting with bypassing postgresql-binary for
unknown
, related to #146, nikita-volkov/bytestring-strict-builder#11. Essentially I wanted to changeValue
tobut that fails at
element
.)The text was updated successfully, but these errors were encountered: