MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / getUniqueConstraints

Function getUniqueConstraints

packages/core/fumadb/src/schema/create.ts:595–612  ·  view source on GitHub ↗
(level = "all")

Source from the content-addressed store, hash-verified

593 foreignKeys: [],
594 policies,
595 getUniqueConstraints(level = "all") {
596 const result: UniqueConstraint[] = [];
597 if (level === "all" || level === "table")
598 result.push(...uniqueConstraints);
599
600 if (level === "all" || level === "column") {
601 for (const col of Object.values(this.columns)) {
602 if (!col.isUnique) continue;
603
604 result.push({
605 name: col.getUniqueConstraintName(),
606 columns: [col],
607 });
608 }
609 }
610
611 return result;
612 },
613 getColumnByName(name, type = "sql") {
614 return Object.values(this.columns).find((c) => c.names[type] === name);
615 },

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
valuesMethod · 0.80

Tested by

no test coverage detected