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

Function requireModel

packages/orm/src/client/query-utils.ts:61–67  ·  view source on GitHub ↗
(schema: SchemaDef, model: string)

Source from the content-addressed store, hash-verified

59}
60
61export function requireModel(schema: SchemaDef, model: string) {
62 const modelDef = getModel(schema, model);
63 if (!modelDef) {
64 throw createInternalError(`Model "${model}" not found in schema`, model);
65 }
66 return modelDef;
67}
68
69export function requireTypeDef(schema: SchemaDef, type: string) {
70 const typeDef = getTypeDef(schema, type);

Callers 15

createModelCrudHandlerFunction · 0.90
sortModelsMethod · 0.90
createModelTableMethod · 0.90
buildRelationJSONFunction · 0.90
buildRelationObjectArgsFunction · 0.90
buildRelationJSONMethod · 0.90
buildSelectModelFunction · 0.90
buildCountJsonFunction · 0.90
requireModelFunction · 0.90
getModelFieldsMethod · 0.90

Calls 2

createInternalErrorFunction · 0.90
getModelFunction · 0.70

Tested by

no test coverage detected