MCPcopy Create free account
hub / github.com/codemix/graph / isUnique

Method isUnique

packages/graph/src/indexes/IndexManager.ts:83–91  ·  view source on GitHub ↗

* Check if a property has a unique index constraint. * @param label The element label. * @param property The property name. * @returns True if the property has a unique constraint.

(label: string, property: string)

Source from the content-addressed store, hash-verified

81 * @returns True if the property has a unique constraint.
82 */
83 public isUnique(label: string, property: string): boolean {
84 const config = this.getIndexConfig(label, property);
85 if (!config) return false;
86 // Only hash and btree indexes support unique constraints
87 if (config.type === "hash" || config.type === "btree") {
88 return config.unique === true;
89 }
90 return false;
91 }
92
93 /**
94 * Get all unique index configurations for a label.

Callers 5

lookupUniqueMethod · 0.95
checkUniqueConstraintMethod · 0.95
buildIndexMethod · 0.95
updatePropertyMethod · 0.80

Calls 1

getIndexConfigMethod · 0.95

Tested by

no test coverage detected