opened
gsamokovarov
username_0
Currently, the deserialization representation of a single element in an
array is always a string. I have hit this problem, while having a single
element deserialize method that expected an Integer, yet it got a
string.

Now, I'm not sure whether the `Type#deserialize(value)` do expects the
value to be coerced by the DB to a suitable type (or it should always
expect a string), but if the type is used standalone and not wrapped in
an array, I do get the coerced value.

This change is an effort in trying to hint the builtin
PG::Text{En,De}coders what the single elements type of the PostgreSQL
array is. If the type has no coder associated with it, we use the
stringified representation as before.
Try to coerce PostgreSQL array single elements types
issue
created
sgrif
username_1
`deserialize` should always be able to handle strings. You should be doing `super + 1` in your type, not `value + 1`
comment
created
sgrif
username_1
(If we can push some of the element decoding into the C level, I'm fine with exploring that. But I don't like this implementation, and there isn't actually a "missing" piece here)
comment
created
gsamokovarov
username_0
Yeah, we can't represent all of the db types with the builtin PG coders, hence nasty `rescue nil`s. Good to know the `#deserialize` expectations.
comment