Releases: drizzle-team/drizzle-orm
0.20.2
- 🎉 Added PostgreSQL network data types:
inet
cidr
macaddr
macaddr8
0.20.1
- 🎉 Added
{ logger: true }
shorthand todrizzle()
to enable query logging. See logging docs for detailed logging configuration.
0.20.0
-
🎉 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.
0.19.1
Changelog
- Add
char
data type support for postgresql by @AlexandrLi in #177 - Adding new section with
New Contributors
for release notes. Took this template from bun release notes pattern
New Contributors
- @AlexandrLi made their first contribution in #177
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.
0.18.0
0.17.7
0.17.6
Fix circular dependency for query building on all pg and mysql drivers
Moved all aws data api typings specific logic to dialect from sql to prevent circular dependency issues
0.17.5
We have released Planetscale Serverless driver support
Usage example:
import { drizzle } from 'drizzle-orm/planetscale-serverless';
import { connect } from '@planetscale/database';
// create the connection
const connection = connect({
host: process.env['DATABASE_HOST'],
username: process.env['DATABASE_USERNAME'],
password: process.env['DATABASE_PASSWORD'],
});
const db = drizzle(connection);
0.17.4
We have released SQLite Proxy Driver
Perfect way to setup custom logic for database calls instead of predefined drivers
Should work well with serverless apps 🚀
// Custom Proxy HTTP driver
const db = drizzle(async (sql, params, method) => {
try {
const rows = await axios.post('http://localhost:3000/query', { sql, params, method });
return { rows: rows.data };
} catch (e: any) {
console.error('Error from sqlite proxy server: ', e.response.data)
return { rows: [] };
}
});
For more example you can check full documentation