Skip to content

Add a catchable way to decode values from a Row #1786

@braker1nine

Description

@braker1nine

Currently when I want to pull values out of a Row particularly in a custom init(row:) method. I make heavy use of the subscript method on Row to pull values out. The version of subscript that returns a non optional value uses force try internally, which means I can't catch any errors when I try to decode that row.

I would love to be able to catch that error and either handle it or log it. I know there are several ways I can handle this myself fairly easily. I've already made my own wrapper to handle it. So I'm really just wondering if there's any interest in making methods like decode(_:forKey:) public so anyone can handle this themselves.

Maybe the answer is just, the need for that isn't huge, it's easy for me to handle in my own way, and saying no to things keeps the API a little simpler and clearer 🤷 That's totally reasonable to me. But I wanted to toss it out there and see.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions