Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@billy1624
Copy link
Member

As suggested on #79

@billy1624 billy1624 self-assigned this Aug 13, 2021
@billy1624
Copy link
Member Author

Now we have...

// If your column names are not in snake-case, derive `DeriveCustomColumn` here.
#[derive(Copy, Clone, Debug, EnumIter, DeriveCustomColumn)]
pub enum Column {
Id,
Name,
}
// Then, customize each column names here.
impl IdenStatic for Column {
fn as_str(&self) -> &str {
match self {
// Override column names
Self::Id => "id",
// Leave all other columns using default snake-case values
_ => self.default_as_str(),
}
}
}

@billy1624 billy1624 force-pushed the custom-column-name-default branch from 7063ff6 to 584c6fc Compare August 13, 2021 04:01
@tyt2y3 tyt2y3 merged commit 69b0ae1 into master Aug 13, 2021
@tyt2y3 tyt2y3 deleted the custom-column-name-default branch August 13, 2021 13:39
@tyt2y3
Copy link
Member

tyt2y3 commented Aug 13, 2021

Remember to release a new ver and change our Cargo

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

Successfully merging this pull request may close these issues.

2 participants