STRICT

Constant STRICT 

Source
pub const STRICT: TableMarker;
Expand description

Enables STRICT mode for the table.

§Example

#[SQLiteTable(strict)]
struct Users {
    #[column(primary)]
    id: i32,
    name: String,
}

§SQLite Behavior

  • Enforces that values match declared column types exactly
  • INTEGER columns only accept integers
  • TEXT columns only accept text
  • REAL columns only accept floating-point numbers
  • BLOB columns only accept blobs
  • ANY type allows any value (only in STRICT tables)

See: https://sqlite.org/stricttables.html