Expand description
Structs§
- Column
- This struct Represents a Column in a Table. It is an Error for the
nameto be Empty (Error::EmptyColumnName). - Foreign
Key - Defines a Foreign Key for a Column. It is an Error for the
foreign_tableandforeign_columnStrings to be Empty (Error::EmptyForeignTableName, Error::EmptyForeignColumnName). - Generated
- Defines a Column as Generated. It is an Error for the
exprString to be Empty (Error::EmptyGeneratorExpr) - NotNull
- Marks a Column as
NOT NULL, meaning the Column cannot containNULLvalues and trying to insertNULLvalues is an Error. - Primary
Key - Marks a Column as a Primary Key. It is an Error to have more than one Primary Key per Table (Error::MultiplePrimaryKeys).
- Schema
- A Schema (or Layout, hence the crate name) encompasses one or more Tables. Can be converted into an SQL Statement via the SQLStatement Methods. It is an Error for the Schema to be empty ([Error::SchemaWithoutTables]).
- Table
- Represents an entire Table, which may be Part of a wider Schema or used standalone.
Can be converted into an SQL Statement via the SQLStatement Methods.
It is an Error for the
nameto be empty (Error::EmptyTableName) or the Table itself to be empty (Error::NoColumns). - Unique
- Marks a Column as “Unique”, meaning the Column cannot contain the same value twice, and trying to insert a value for the second time is an Error.
- View
- Represents an entire View, which may be Part of a wider Schema or used standalone.
Can be converted into an SQL Statement via the SQLStatement Methods.
It is an Error for the
nameto be empty (Error::EmptyViewName) or the Select to be empty (Error::EmptyViewSelect). - View
Column
Enums§
- Error
- Errors for all Structs and Functions in this Crate.
- FKOn
Action - Reaction to an action on a Column with a ForeignKey See also here
- Generated
As - Weather a generated column should store its values or compute them on every access
- OnConflict
- Reaction to a violated Constraint, used by PrimaryKey, NotNull and Unique. See also here
- Order
- PrimaryKey direction
- SQLite
Type - Encodes all Column-Datatypes available in SQLite, see here.
Traits§
- SQLStatement
- Any struct implementing this trait can be converted into an SQL statement String.
Optionally, the statement can be wrapped in an SQL Transaction and/or guarded against already existing Tables with a
...IF NOT EXISTS...guard.