ryzz icon indicating copy to clipboard operation
ryzz copied to clipboard

support min and max values for numeric types

Open JosiahParry opened this issue 1 year ago • 0 comments

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,
}

JosiahParry avatar Jun 27 '24 00:06 JosiahParry