0.19.0
-
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 withdb.select({ ... }).from(table)
to look more like its SQL counterpart.