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
//! Relations for [SeaORM](https://www.sea-ql.org/SeaORM/) that it does not have out of
//! the box, with the operations that make them practical.
//!
//! - **Polymorphic relations**, where a child row points at an owner that can be one of
//! several entities (`commentable_type` + `commentable_id`): [`Morph`] for one-to-one
//! and one-to-many, with the child resolving its owner through [`morph_target!`];
//! [`MorphToMany`] for many-to-many through a pivot; [`Morphable`] names each owner
//! entity.
//! - **Pivot operations** for polymorphic and plain ([`BelongsToMany`]) many-to-many:
//! `attach`, `detach`, `sync`, `sync_without_detaching`, `toggle`,
//! `update_pivot`, ordered pivots and extra pivot columns.
//! - **Eager loading and counts** without N+1: `load_for`, `count_for`.
//! - **For `SeaORM`'s own relations** (anything with `Related<R>`): [`count_related`],
//! [`exists_related`], [`aggregate_related`] (sum, average, min, max) and one row per
//! owner by a column ([`latest_of_many`], [`oldest_of_many`], [`of_many`]).
//! - **Filters** as conditions for any query: owners that have (or lack) matching
//! related rows, children whose owner matches a query, owners with all given keys.
//! - **Migrations**: [`schema`] builds the polymorphic columns and their index.
//!
//! Batch methods put the owners' keys in one `IN (...)` list; pass a page of rows,
//! not a whole table (Postgres allows 65 535 bind parameters per query).
//!
//! Polymorphic columns cannot have a foreign key, so the database cannot clean up
//! after a deleted owner. Call `delete_for` / `detach_all` in the owner's delete hook,
//! or `delete_orphans` from a scheduled task.
pub use Key;
pub use ;
pub use Pick;
pub use ;
pub use ;
pub use MorphTarget;
/// Used by [`morph_target!`]; not part of the public API.