You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tobyweston, in the first case I'm not sure what a good solution could look like, as these types can be different for each row. Maybe we could add type parameters to the query for when you know the types in advance and just fail the query if one row doesn't match. What do you think?
And yes, records should return Options instead of throwing an exception. Right now you can only surround it with a try-catch.
to handle the error and absence of the value at the same time?
I don't know if there are other constraints within the codebase that make implicits not a good option but from a client API perspective, i'd certainly prefer not to have to care how types are pulled back. I haven't tried it yet so hypothetical ATM 👍
As the query results are
Any
, how do you suggest deriving types for the values?For example:
but that seems nasty. Do you retain the type from the JSON wire format? Any fancy implicit encoders available?
Similarly, how do you advice handling values which may be not there, e.g.
Would be nice, but as it stands I can get
NoSuchElementException
when I request something that isn't there.I had a poke around but couldn't find anything obvious.
Thanks in advance
The text was updated successfully, but these errors were encountered: