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 min and max values for numeric types #11

Open
JosiahParry opened this issue Jun 27, 2024 · 0 comments
Open

support min and max values for numeric types #11

JosiahParry opened this issue Jun 27, 2024 · 0 comments

Comments

@JosiahParry
Copy link
Contributor

It would be sweet to pre-specify ranges of values that can be used to validate the struct prior to entry.

For example this would be 🔥

#[table("shiny_apps")]
struct ShinyAppRow {
    #[ryzz(pk)]
    id: String,
    name: String,
    slug: Option<String>,
    #[ryzz(default = 0, min = 0)]
    min_instances: i64,
    #[ryzz(default = 0, min = 1)]
    max_instances: i64,
    #[ryzz(default = 0, min = 0)]
    spawn_threshold: i64,
    #[ryzz(default = 240)]
    inactive_timeout: i64,
    #[ryzz(default = 60, min = 30, max = 180)]
    connection_timeout: i64,
}
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

No branches or pull requests

1 participant