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
//! The primary key of an entity, modeled by [`PrimaryKeyTrait`].
//!
//! The derive macro generates a `PrimaryKey` enum with one variant per key
//! column and implements both traits here on it. Splitting the key out of
//! the `Column` enum lets the query builders iterate exactly the key columns
//! when rendering `WHERE pk = ?` conditions, and lets
//! [`PrimaryKeyTrait::ValueType`] be the field type for a single column or a
//! tuple for a composite key, so `find_by_id(1)` and
//! `find_by_id((1, "a".to_owned()))` both type-check.
use crate;
use ;
/// The primary key of an entity, derived on the `PrimaryKey` enum.
/// The mapping between primary-key variants and column variants.