-
-
Notifications
You must be signed in to change notification settings - Fork 711
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add changelog, bump ORM version to 0.19.0
- Loading branch information
1 parent
0f4b037
commit c0cd0b3
Showing
5 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
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,17 @@ | ||
- Implemented selecting and joining a subquery. Example usage: | ||
|
||
```ts | ||
const sq = db | ||
.select({ | ||
categoryId: courseCategoriesTable.id, | ||
category: courseCategoriesTable.name, | ||
total: sql`count(${courseCategoriesTable.id})`.as<number>(), | ||
}) | ||
.from(courseCategoriesTable) | ||
.groupBy(courseCategoriesTable.id, courseCategoriesTable.name) | ||
.subquery('sq'); | ||
``` | ||
|
||
After that, just use the subquery instead of a table as usual. | ||
|
||
- ❗ Replaced `db.select(table).fields({ ... })` syntax with `db.select({ ... }).from(table)` to look more like its SQL counterpart. |
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
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