Skip to content

Commit

Permalink
fix(driver): use inherited joinByType method
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Nov 4, 2023
1 parent 4a9e396 commit b1e7e7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 33 deletions.
2 changes: 2 additions & 0 deletions src/drivers/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ export abstract class Driver<Client = any, QB = any> {
}

this.qb[joinType](table, column1, operation, column2)

return this
}

/**
Expand Down
33 changes: 0 additions & 33 deletions src/drivers/PostgresDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1221,37 +1221,4 @@ export class PostgresDriver extends Driver<Knex, Knex.QueryBuilder> {

return this
}

/**
* Create a join clause by join type
*/
public joinByType(
joinType: string,
table: any,
column1?: any,
operation?: any,
column2?: any
): this {
if (!column1) {
this.qb[joinType](table)

return this
}

if (!operation) {
this.qb[joinType](table, column1)

return this
}

if (!column2) {
this.qb[joinType](table, column1, operation)

return this
}

this.qb[joinType](table, column1, operation, column2)

return this
}
}

0 comments on commit b1e7e7f

Please sign in to comment.