-
🎉 Implemented support for WITH clause (docs). Example usage:
const sq = db .select() .from(users) .prepareWithSubquery('sq'); const result = await db .with(sq) .select({ id: sq.id, name: sq.name, total: sql<number>`count(${sq.id})::int`(), }) .from(sq) .groupBy(sq.id, sq.name);
-
🐛 Fixed various bugs with selecting/joining of subqueries.
-
❗ Renamed
.subquery('alias')
to.as('alias')
. -
❗
sql`query`.as<type>()
is nowsql<type>`query`()
. Old syntax is still supported, but is deprecated and will be removed in one of the next releases.