Expand description
Attribute markers for SQLiteTable derive macro.
These const markers are used within #[column(...)] and #[SQLiteTable(...)]
attributes. Import them from the prelude to get IDE hover documentation.
§Example
ⓘ
#[SQLiteTable(name = "users", strict)]
struct User {
#[column(primary, autoincrement)]
id: i32,
#[column(unique)]
email: String,
metadata: String,
}Structs§
- Column
Marker - Marker struct for column constraint attributes.
- Name
Marker - Marker struct for the NAME attribute.
- Table
Marker - Marker struct for table-level attributes.
- Type
Marker - Marker struct for column type attributes.
- View
Marker - Marker struct for view attributes.
Constants§
- ANY
- Specifies an ANY column type (STRICT tables only).
- AUTOINCREMENT
- Enables AUTOINCREMENT for INTEGER PRIMARY KEY columns.
- BLOB
- Specifies a BLOB column type.
- BOOLEAN
- Specifies a BOOLEAN column (stored as INTEGER 0/1).
- CASCADE
- CASCADE action: Propagate the delete/update to referencing rows.
- DEFAULT
- Specifies a fixed default value for new rows.
- DEFAULT_
FN - Specifies a function to generate default values at runtime.
- DEFINITION
- Specifies a view definition SQL string or expression.
- ENUM
- Marks this column as storing an enum type.
- EXISTING
- Marks the view as existing (skip creation).
- INTEGER
- Specifies an INTEGER column type.
- JSON
- Enables JSON serialization with TEXT storage.
- JSONB
- Enables JSON serialization with BLOB storage.
- NAME
- Specifies a custom name in the database.
- NO_
ACTION - NO ACTION action: Similar to RESTRICT (default behavior).
- NUMERIC
- Specifies a NUMERIC column type.
- ON_
DELETE - Specifies the ON DELETE action for foreign key references.
- ON_
UPDATE - Specifies the ON UPDATE action for foreign key references.
- PRIMARY
- Marks this column as the PRIMARY KEY.
- PRIMARY_
KEY - Alias for
PRIMARY. - REAL
- Specifies a REAL column type.
- REFERENCES
- Establishes a foreign key reference to another table’s column.
- RESTRICT
- RESTRICT action: Prevent delete/update if referenced.
- SET_
DEFAULT - SET DEFAULT action: Set referencing columns to their default values.
- SET_
NULL - SET NULL action: Set referencing columns to NULL.
- STRICT
- Enables STRICT mode for the table.
- TEXT
- Specifies a TEXT column type.
- UNIQUE
- Adds a UNIQUE constraint to this column.
- WITHOUT_
ROWID - Enables WITHOUT ROWID optimization for the table.
Type Aliases§
- Referential
Action - Type alias for referential action markers (uses ColumnMarker for macro compatibility).