1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! The entity layer: entities, models, active models, columns, primary keys and relations.
//!
//! An entity module written by hand or expanded by `DeriveEntityModel`
//! consists of a unit struct `Entity`, a plain `Model` struct holding one
//! row, a `Column` enum, a `PrimaryKey` enum, a change-tracking `ActiveModel`
//! and a `Relation` enum. This module owns the traits each of those types
//! implements and the glue between them; it does not own SQL rendering
//! (that is `turso_sql`) nor execution (that is the driver).
//!
//! - [`EntityTrait`] ties the pieces together and is the entry point for
//! queries (`Entity::find()`, `Entity::insert(..)`).
//! - [`ModelTrait`] and [`FromQueryResult`] read rows into structs.
//! - [`ActiveModelTrait`] and [`ActiveValue`] track which attributes to write.
//! - [`ColumnTrait`] provides the condition builders on column enums.
//! - [`PrimaryKeyTrait`] and [`PrimaryKeyToColumn`] describe the key.
//! - [`RelationTrait`], [`Related`], [`RelationDef`] and [`Linked`] describe
//! joins, junction tables, multi-hop chains and the foreign keys they
//! imply.
//! - [`LoaderTrait`] batch-loads related rows for a list of models.
//! - [`ActiveEnum`] maps a Rust enum onto a text or integer column.
//! - [`PartialModelTrait`] selects and decodes a subset of columns.
//! - [`Schema`] turns an entity into `CREATE TABLE` and `CREATE INDEX`
//! statements.
//!
//! The `active_model`, `iden`, `model` and `relation` submodules are
//! `pub(crate)` because the crate root re-exports helpers from them through
//! `__private` for the benefit of generated code, or because the query
//! builders share helpers with them.
pub
pub
pub
pub
pub
pub use ActiveEnum;
pub use ;
pub use EntityTrait;
pub use ;
pub use ;
pub use LoaderTrait;
pub use ;
pub use PartialModelTrait;
pub use ;
pub use ;
pub use Schema;