-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
This is possibly a bit of a complex issue. I have a model I defined here:
#[model]
pub struct Meetup {
#[model(primary_key)]
pub id: Auto<i32>,
pub r#type: LimitedString<255>,
pub title: LimitedString<255>,
pub r#abstract: String,
}For a field like title, I have no issues. But for field names such as type or abstract, which are reserved keywords, I need to add the r# prefix.
And when the migration is created, it takes literally r#type. Also, there are times where you can have a parameter of a certain name but want to map it to a different name in the db.
Maybe having something like the following would be useful?
#[model]
pub struct Meetup {
#[model(primary_key)]
pub id: Auto<i32>,
#[dbfield("type")]
pub r#type: LimitedString<255>,
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers