MCPcopy
hub / github.com/eveningkid/denodb / join

Method join

lib/model.ts:710–722  ·  view source on GitHub ↗

Join a table to the current query. * * await Flight.where( * Flight.field("departure"), * "Paris", * ).join( * Airport, * Airport.field("id"), * Flight.field("airportId"), * ).get()

(
    this: T,
    joinTable: ModelSchema,
    originField: string,
    targetField: string,
  )

Source from the content-addressed store, hash-verified

708 * ).get()
709 */
710 static join<T extends ModelSchema>(
711 this: T,
712 joinTable: ModelSchema,
713 originField: string,
714 targetField: string,
715 ) {
716 this._currentQuery.join(
717 joinTable.table,
718 joinTable.formatFieldToDatabase(originField) as string,
719 this.formatFieldToDatabase(targetField) as string,
720 );
721 return this;
722 }
723
724 /** Join a table with left outer statement to the current query.
725 *

Callers 2

hasManyMethod · 0.45
translateToQueryMethod · 0.45

Calls 1

formatFieldToDatabaseMethod · 0.95

Tested by

no test coverage detected