MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / getRelationName

Function getRelationName

packages/cli/src/actions/pull/utils.ts:132–136  ·  view source on GitHub ↗
(decl: DataField)

Source from the content-addressed store, hash-verified

130 * e.g., @relation('backRef') -> "backRef"
131 */
132export function getRelationName(decl: DataField): string | undefined {
133 const relationAttr = decl?.attributes?.find((a) => a.decl?.ref?.name === '@relation');
134 if (!relationAttr) return undefined;
135 return getAttributeArgLiteral(relationAttr, 'name');
136}
137
138/**
139 * Gets the FK field names from the @relation attribute's `fields` argument.

Callers 2

runPullFunction · 0.90

Calls 2

getAttributeArgLiteralFunction · 0.90
findMethod · 0.80

Tested by

no test coverage detected