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,
)
| 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 | * |
no test coverage detected