icydb_schema/node/primary_key.rs
1use crate::prelude::*;
2
3///
4/// PrimaryKey
5///
6/// Structured primary-key metadata for an entity schema.
7///
8
9#[derive(Clone, Debug, Serialize)]
10pub struct PrimaryKey {
11 pub field: &'static str,
12
13 #[serde(default)]
14 pub source: PrimaryKeySource,
15}
16
17///
18/// PrimaryKeySource
19///
20/// Declares where primary-key values originate.
21///
22
23#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)]
24pub enum PrimaryKeySource {
25 #[default]
26 Internal,
27
28 External,
29}