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

proc-macro derive panicked message: "r#type" is not a valid identifier #32

Open
holmofy opened this issue Sep 1, 2023 · 1 comment
Open

Comments

@holmofy
Copy link

holmofy commented Sep 1, 2023

#[derive(Debug, Model)]
#[ormlite(table = "schedule_config")]
pub struct ScheduleConfig {
    #[ormlite(primary_key)]
    pub id: i64,
    pub user_id: i64,
    pub store_id: i64,
    pub proxy_id: i64,
    pub r#type: SchedulerType,
    pub finished: bool,
    pub cron: String,
}

This r#type field cannot be processed by macros.

error: proc-macro derive panicked
 --> src/model/data_store_meta.rs:7:24
  |
7 | #[derive(Clone, Debug, Model)]
  |                        ^^^^^
  |
  = help: message: `"r#type"` is not a valid identifier
@kurtbuilds
Copy link
Owner

Thank you for reporting this. This is a straight forward bugfix, that I will get to, though I'm on vacation right now. Easy workaround should be naming the column to typ or similar, and using a #[ormlite(column = "type")] attribute.

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