Skip to content

Add From<rusqlite::Error> generic to conn functions #18

@tmpfs

Description

@tmpfs

The rusqlite library has query_and_then which allows us to map rusqlite::Error to a higher-order Error type that implements From<rusqlite::Error>. This is particularly useful for loading rows and converting each row to a more application-specific type.

However, I can't then return those errors as async-sqlite is tightly bound to to rusqlite::Error in the conn functions.

If we could add another generic which requires E: From<rusqlite::Error> to the conn() functions then it would be possible to return custom errors and use query_and_then as intended.

Happy to submit a PR if you are open to this 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions