-
Notifications
You must be signed in to change notification settings - Fork 58
Add support for specifying a different database name for fields #174
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
Conversation
| VarChar(u64), | ||
|
|
||
| /// User-specified unrecognized type | ||
| Custom(&'static str), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want this to be String to allow runtime specification of custom types. I don't think allocations will be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I changed it to String
carllerche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment inline.
| name: name.app_name.clone(), | ||
| storage_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK merging the PR with this, but as a follow up, I don't think we need to track app_name here. app_name is the app-level field name. db::Column is the storage name. If there is something I am missing, let me know.
Adds custom column names with one of the following syntax options:
Removes the
#[db(type)]attribute.You can also either specify a varchar type like before:
#[column(type = varchar(5))]or a custom type with a raw string:
#[column(type = "jsonb")]Also adds two tests to check if the column was really renamed.
Closes #153