forked from kysely-org/kysely
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
143 additions
and
28 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
site/docs/examples/SELECT/0020-a-single-colum-with-table.mdx
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../SELECT/0020-a-single-colum-with-table.js → ...amples/SELECT/0020-column-with-a-table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const aSingleColumWithTable = `const persons = await db | ||
export const columnWithATable = `const persons = await db | ||
.selectFrom(['person', 'pet']) | ||
.select('person.id') | ||
.execute()` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: 'Column with a table' | ||
--- | ||
|
||
# Column with a table | ||
|
||
Select a single column and specify a table: | ||
|
||
import { | ||
Playground, | ||
exampleSetup, | ||
} from '../../../src/components/Playground' | ||
|
||
import { | ||
columnWithATable | ||
} from './0020-column-with-a-table' | ||
|
||
<Playground code={columnWithATable} setupCode={exampleSetup} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const allColumns = `const persons = await db | ||
.selectFrom('person') | ||
.selectAll() | ||
.execute()` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: 'All columns' | ||
--- | ||
|
||
# All columns | ||
|
||
The `selectAll` method generates `SELECT *`: | ||
|
||
import { | ||
Playground, | ||
exampleSetup, | ||
} from '../../../src/components/Playground' | ||
|
||
import { | ||
allColumns | ||
} from './0090-all-columns' | ||
|
||
<Playground code={allColumns} setupCode={exampleSetup} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const allColumnsOfATable = `const persons = await db | ||
.selectFrom('person') | ||
.selectAll('person') | ||
.execute()` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: 'All columns of a table' | ||
--- | ||
|
||
# All columns of a table | ||
|
||
Select all columns of a table: | ||
|
||
import { | ||
Playground, | ||
exampleSetup, | ||
} from '../../../src/components/Playground' | ||
|
||
import { | ||
allColumnsOfATable | ||
} from './0100-all-columns-of-a-table' | ||
|
||
<Playground code={allColumnsOfATable} setupCode={exampleSetup} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const orWhere = `const persons = await db | ||
.selectFrom('person') | ||
.selectAll() | ||
.where(({ or, and, cmpr }) => or([ | ||
and([ | ||
cmpr('first_name', '=', 'Jennifer'), | ||
cmpr('last_name', '=', 'Aniston') | ||
]), | ||
and([ | ||
cmpr('first_name', '=', 'Sylvester'), | ||
cmpr('last_name', '=', 'Stallone') | ||
]) | ||
])) | ||
.execute()` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: 'OR where' | ||
--- | ||
|
||
# OR where | ||
|
||
To combine conditions using `OR`, you can use the expression builder: | ||
|
||
import { | ||
Playground, | ||
exampleSetup, | ||
} from '../../../src/components/Playground' | ||
|
||
import { | ||
orWhere | ||
} from './0030-or-where' | ||
|
||
<Playground code={orWhere} setupCode={exampleSetup} /> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters