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

Function getManyToManyRelation

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

Source from the content-addressed store, hash-verified

290}
291
292export function getManyToManyRelation(schema: SchemaDef, model: string, field: string) {
293 const cache = getSchemaLookupCache(schema);
294 const key = `${model} ${field}`;
295 if (cache.m2mRelation.has(key)) {
296 return cache.m2mRelation.get(key);
297 }
298 const result = computeManyToManyRelation(schema, model, field);
299 cache.m2mRelation.set(key, result);
300 return result;
301}
302
303/**
304 * Endpoints of an implicit many-to-many relation, identified by its join table name.

Callers 13

constructorMethod · 0.90
buildRelationJoinFilterFunction · 0.90
buildPkFkWhereRefsFunction · 0.90
buildCountJsonFunction · 0.90
createFunction · 0.90
resetManyToManyRelationFunction · 0.90
connectRelationFunction · 0.90
disconnectRelationFunction · 0.90
setRelationFunction · 0.90
deleteRelationFunction · 0.90

Calls 2

getSchemaLookupCacheFunction · 0.85

Tested by

no test coverage detected