Skip to main content

CHECK

Constant CHECK 

Source
pub const CHECK: ColumnMarker;
Expand description

Adds a CHECK constraint for a column or table.

ยงExamples

#[column(check = "score >= 0")]
score: i32,

#[SQLiteTable(check(name = "score_range", expr = "score >= 0 AND score <= 100"))]
struct Scores {
    score: i32,
}

See: https://sqlite.org/lang_createtable.html#check_constraints