Skip to content

0.19.0

Compare
Choose a tag to compare
@github-actions github-actions released this 09 Feb 10:31
· 2200 commits to main since this release
7032b9b
  • Implemented selecting and joining a subquery. Example usage:

    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.