Skip to content

Releases: drizzle-team/drizzle-orm

0.20.2

21 Feb 21:24
1bd39a9
Compare
Choose a tag to compare
  • 🎉 Added PostgreSQL network data types:
    • inet
    • cidr
    • macaddr
    • macaddr8

0.20.1

19 Feb 20:29
8c9691b
Compare
Choose a tag to compare
  • 🎉 Added { logger: true } shorthand to drizzle() to enable query logging. See logging docs for detailed logging configuration.

0.20.0

19 Feb 01:21
e8d0715
Compare
Choose a tag to compare
  • 🎉 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 now sql<type>`query`(). Old syntax is still supported, but is deprecated and will be removed in one of the next releases.

0.19.1

16 Feb 12:46
89057df
Compare
Choose a tag to compare

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


0.19.0

09 Feb 10:31
7032b9b
Compare
Choose a tag to compare
  • 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.

0.18.0

06 Feb 12:28
cdd79a3
Compare
Choose a tag to compare
  • Improved join result types for partial selects (refer to the docs page for more information)
  • Renamed import paths for Postgres.js and SQL.js drivers to avoid bundling errors:
    • drizzle-orm/postgres.js -> drizzle-orm/postgres-js
    • drizzle-orm/sql.js -> drizzle-orm/sql-js

0.17.7

05 Feb 16:18
7ec585f
Compare
Choose a tag to compare
  • Fix #158 issue. Method .returning() was working incorrectly with .get() method in sqlite dialect
  • Fix SQLite Proxy driver mapping bug
  • Add test cases for SQLite Proxy driver
  • Add additional example for SQLite Proxy Server setup to handle .get() as well

0.17.6

03 Feb 20:43
d2fded0
Compare
Choose a tag to compare

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

03 Feb 11:27
a371248
Compare
Choose a tag to compare

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

02 Feb 19:04
3da5e14
Compare
Choose a tag to compare

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