MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / add_foreign_key

Method add_foreign_key

nodedb-crdt/src/constraint.rs:89–106  ·  view source on GitHub ↗

Add a FOREIGN KEY constraint.

(
        &mut self,
        name: &str,
        collection: &str,
        field: &str,
        ref_collection: &str,
        ref_key: &str,
    )

Source from the content-addressed store, hash-verified

87
88 /// Add a FOREIGN KEY constraint.
89 pub fn add_foreign_key(
90 &mut self,
91 name: &str,
92 collection: &str,
93 field: &str,
94 ref_collection: &str,
95 ref_key: &str,
96 ) {
97 self.add(Constraint {
98 name: name.to_string(),
99 collection: collection.to_string(),
100 field: field.to_string(),
101 kind: ConstraintKind::ForeignKey {
102 ref_collection: ref_collection.to_string(),
103 ref_key: ref_key.to_string(),
104 },
105 });
106 }
107
108 /// Add a BITEMPORAL FOREIGN KEY constraint.
109 pub fn add_bitemporal_fk(

Callers 4

setupFunction · 0.80
user_schemaFunction · 0.80
schemaFunction · 0.80

Calls 2

to_stringMethod · 0.80
addMethod · 0.45

Tested by 4

setupFunction · 0.64
user_schemaFunction · 0.64
schemaFunction · 0.64