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

Function getSchemaLookupCache

packages/orm/src/client/query-utils.ts:37–44  ·  view source on GitHub ↗
(schema: SchemaDef)

Source from the content-addressed store, hash-verified

35const schemaLookupCache = new WeakMap<SchemaDef, SchemaLookupCache>();
36
37function getSchemaLookupCache(schema: SchemaDef): SchemaLookupCache {
38 let cache = schemaLookupCache.get(schema);
39 if (!cache) {
40 cache = { model: new Map(), m2mRelation: new Map() };
41 schemaLookupCache.set(schema, cache);
42 }
43 return cache;
44}
45
46export function getModel(schema: SchemaDef, model: string) {
47 const cache = getSchemaLookupCache(schema);

Callers 3

getModelFunction · 0.85
getManyToManyRelationFunction · 0.85
getManyToManyJoinTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected