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

Method leftJoin

lib/model.ts:760–772  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

758 * ).get()
759 */
760 static leftJoin<T extends ModelSchema>(
761 this: T,
762 joinTable: ModelSchema,
763 originField: string,
764 targetField: string,
765 ) {
766 this._currentQuery.leftJoin(
767 joinTable.table,
768 joinTable.formatFieldToDatabase(originField) as string,
769 this.formatFieldToDatabase(targetField) as string,
770 );
771 return this;
772 }
773
774 /** Count the number of records of a model or filtered by a field name.
775 *

Callers 1

translateToQueryMethod · 0.45

Calls 1

formatFieldToDatabaseMethod · 0.95

Tested by

no test coverage detected