MCPcopy
hub / github.com/strapi/strapi / join

Function join

packages/core/database/src/query/query-builder.ts:369–389  ·  view source on GitHub ↗
(join)

Source from the content-addressed store, hash-verified

367 },
368
369 join(join) {
370 if (!join.targetField) {
371 state.joins.push(join);
372 return this;
373 }
374
375 const model = db.metadata.get(uid);
376 const attribute = model.attributes[join.targetField];
377
378 helpers.createJoin(
379 { db, qb: this, uid },
380 {
381 alias: this.alias,
382 refAlias: join.alias,
383 attributeName: join.targetField,
384 attribute,
385 }
386 );
387
388 return this;
389 },
390
391 mustUseAlias() {
392 return ['select', 'count'].includes(state.type);

Callers 15

editCategoryFunction · 0.85
createBuilderFunction · 0.85
query-populate.tsFile · 0.85
getDirsFunction · 0.85
koa.test.tsFile · 0.85
loadPoliciesFunction · 0.85
loadAPIsFunction · 0.85
loadAPIFunction · 0.85
loadIndexFunction · 0.85
loadContentTypesFunction · 0.85
loadDirFunction · 0.85
loadComponentsFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…