(decl: DataField)
| 130 | * e.g., @relation('backRef') -> "backRef" |
| 131 | */ |
| 132 | export 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. |
no test coverage detected