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

Support database-level constraints on columns #19

Open
CrsiX opened this issue Nov 9, 2022 · 0 comments
Open

Support database-level constraints on columns #19

CrsiX opened this issue Nov 9, 2022 · 0 comments
Labels
enhancement New feature or request v0.6 Relevant for next release

Comments

@CrsiX
Copy link
Contributor

CrsiX commented Nov 9, 2022

It would be nice to see support for check constraints which are based on database features. Of course, the support for those must be evaluated first. Below is a short example how using the constraints could look like, but I'm open for other suggestions as well:

#[derive(Clone, Debug, Model)]
struct User {
    #[rorm(id)]
    id: i64,

    #[rorm(max_length = 255)]
    username: String,

    #[rorm(unsigned)]
    age: i32,

    #[rorm(constraint = "< 1337")]
    score: i32
}
@myOmikron myOmikron added the enhancement New feature or request label Nov 9, 2022
@myOmikron myOmikron added the v0.6 Relevant for next release label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v0.6 Relevant for next release
Projects
None yet
Development

No branches or pull requests

2 participants