Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedural macro for RowValue #49

Closed
Flowneee opened this issue Jan 20, 2022 · 2 comments
Closed

Procedural macro for RowValue #49

Flowneee opened this issue Jan 20, 2022 · 2 comments

Comments

@Flowneee
Copy link

Implementations of RowValue for structs is usually simple and all similar, so it make sense to make #[derive(RowValue)] macro (in our case we had struct with over 150 fields). We currently have our own implementation of this procedural macro and we want to have it in rust-oracle. Do you interested in PR in this repo (with proc-macro crate, enabled by feature) or should we publish it separately?

Example

#[derive(RowValue)]
struct Row {
    id: i64,
    #[row_value(rename = "timestamp")
    ts: NaiveDateTime,
    #[row_value(with = "custom::parse::fn")]
    name: Option<String>,
}
@kubo
Copy link
Owner

kubo commented Jan 22, 2022

@Flowneee
Thanks. It is very interesting. The pull request is welcome!

@kubo
Copy link
Owner

kubo commented Feb 28, 2022

Thanks! #51 was merged.

I'll revise doc comment about the RowValue derive macro later because it is placed in docs about the oracle crate.

@kubo kubo closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants