(schema: SchemaDef, model: string)
| 138 | } |
| 139 | |
| 140 | export function requireIdFields(schema: SchemaDef, model: string) { |
| 141 | const modelDef = requireModel(schema, model); |
| 142 | const result = modelDef?.idFields; |
| 143 | if (!result) { |
| 144 | throw createInternalError(`Model "${model}" does not have ID field(s)`, model); |
| 145 | } |
| 146 | return result; |
| 147 | } |
| 148 | |
| 149 | export function getRelationForeignKeyFieldPairs(schema: SchemaDef, model: string, relationField: string) { |
| 150 | const fieldDef = requireField(schema, model, relationField); |
no test coverage detected