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

Allow distinct types in schema::custom() #2326

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

sgoll
Copy link
Contributor

@sgoll sgoll commented Aug 11, 2024

PR Info

Bug Fixes

  • Allow col and name to come from different DeriveIden structs in schema::custom().

Breaking Changes

  • The signature of schema::custom() gains another generic type argument.

Strictly speaking, this may be considered a breaking change. However, it remains unclear whether explicitly stating the generic type argument is something that is actually done in the wild.

Rationale

The proposed change is in line with the existing signature of schema::enumeration(), another method that uses more than one IntoIden argument:

pub fn enumeration<T, N, S, V>(col: T, name: N, variants: V) -> ColumnDef
where
T: IntoIden,
N: IntoIden,
S: IntoIden,
V: IntoIterator<Item = S>,
{
ColumnDef::new(col)
.enumeration(name, variants)
.not_null()
.take()
}

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! @sgoll

@billy1624 billy1624 merged commit 31ef8c7 into SeaQL:master Oct 4, 2024
25 checks passed
Copy link

github-actions bot commented Oct 4, 2024

🎉 Released In 1.1.0-rc.2 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

Copy link

🎉 Released In 1.1.0 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

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.

schema::custom() requires col and name to be of same type
2 participants