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

Method add_unique

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

Add a UNIQUE constraint.

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

Source from the content-addressed store, hash-verified

77
78 /// Add a UNIQUE constraint.
79 pub fn add_unique(&mut self, name: &str, collection: &str, field: &str) {
80 self.add(Constraint {
81 name: name.to_string(),
82 collection: collection.to_string(),
83 field: field.to_string(),
84 kind: ConstraintKind::Unique,
85 });
86 }
87
88 /// Add a FOREIGN KEY constraint.
89 pub fn add_foreign_key(

Callers 6

setupFunction · 0.80
user_schemaFunction · 0.80
schemaFunction · 0.80
test_constraintsFunction · 0.80
tenantFunction · 0.80

Calls 2

to_stringMethod · 0.80
addMethod · 0.45

Tested by 6

setupFunction · 0.64
user_schemaFunction · 0.64
schemaFunction · 0.64
test_constraintsFunction · 0.64
tenantFunction · 0.64