Skip to content

Auto Generate Return Types When Specified #4

@mcmah309

Description

@mcmah309

For returning statements, we could inject the type that should be returned automatically if it is included.

e.g.

-- name: add_new_book->ReturnType

Which will generate something like

fn add_new_book(&self, isbn: &str, book_title: &str) -> rusqlite::Result<ReturnType>;

ReturnType would need to implement a trait like FromRow. We could use the trait from this crate to automatically derive it: https://github.com/remkop22/rusqlite-from-row . Either copy the work or re-export.

So there is no need for a row_callback for when the return type is specified.

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