Skip to content

Commit

Permalink
Merge branch 'master' into feat-identity
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov authored Feb 14, 2024
2 parents 4864413 + 573ee72 commit 8de1155
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"esbuild": "^0.19.11",
"lodash": "^4.17.21",
"mocha": "^10.2.0",
"mysql2": "^3.6.5",
"pg": "^8.11.3",
Expand Down
1 change: 1 addition & 0 deletions site/docs/examples/JOIN/0030-complex-join.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const complexJoin = `await db.selectFrom('person')
(join) => join
.onRef('pet.owner_id', '=', 'person.id')
.on('pet.name', '=', 'Doggo')
.on((eb) => eb.or([eb("person.age", ">", 18), eb("person.age", "<", 100)]))
)
.selectAll()
.execute()`
6 changes: 4 additions & 2 deletions site/docs/examples/JOIN/0030-complex-join.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ You can provide a function as the second argument to get a join
builder for creating more complex joins. The join builder has a
bunch of `on*` methods for building the `on` clause of the join.
There's basically an equivalent for every `where` method
(`on`, `onRef` etc.). You can do all the same things with the
`on` method that you can with the corresponding `where` method.
(`on`, `onRef` etc.).

You can do all the same things with the
`on` method that you can with the corresponding `where` method (like [OR expressions for example](https://kysely.dev/docs/examples/WHERE/or-where)).
See the `where` method documentation for more examples.

import {
Expand Down
7 changes: 5 additions & 2 deletions src/query-builder/select-query-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,10 @@ export interface SelectQueryBuilder<DB, TB extends keyof DB, O>
* builder for creating more complex joins. The join builder has a
* bunch of `on*` methods for building the `on` clause of the join.
* There's basically an equivalent for every `where` method
* (`on`, `onRef` etc.). You can do all the same things with the
* `on` method that you can with the corresponding `where` method.
* (`on`, `onRef` etc.).
*
* You can do all the same things with the
* `on` method that you can with the corresponding `where` method (like [OR expressions for example](https://kysely.dev/docs/examples/WHERE/or-where)).
* See the `where` method documentation for more examples.
*
* ```ts
Expand All @@ -591,6 +593,7 @@ export interface SelectQueryBuilder<DB, TB extends keyof DB, O>
* (join) => join
* .onRef('pet.owner_id', '=', 'person.id')
* .on('pet.name', '=', 'Doggo')
* .on((eb) => eb.or([eb("person.age", ">", 18), eb("person.age", "<", 100)]))
* )
* .selectAll()
* .execute()
Expand Down

0 comments on commit 8de1155

Please sign in to comment.