Skip to content

Releases: drizzle-team/drizzle-orm

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

0.17.3

31 Jan 20:17
dd587f5
Compare
Choose a tag to compare

We have released AWS Data API support for PostgreSQL


Connection example

import { drizzle, migrate } from 'drizzle-orm/aws-data-api/pg';

const rdsClient = new RDSDataClient({});

const db = drizzle(rdsClient, {
  database: '',
  secretArn: '',
  resourceArn: '',
});

await migrate(db, { migrationsFolder: '' });

Note:
All drizzle pg data types are working well with data api, except of interval. This type is not yet mapped in proper way

0.17.2

30 Jan 14:39
ed722e7
Compare
Choose a tag to compare
  • Fixed package.json require path in drizzle-orm/version

0.17.1

27 Jan 13:35
973e4d2
Compare
Choose a tag to compare
  • Added feature showcase section to README

0.17.0

26 Jan 17:56
3753d10
Compare
Choose a tag to compare

❗ All ORM packages are now merged into drizzle-orm

Starting from release 0.17.0 and onwards, all dialect-specific packages are merged into drizzle-orm. Legacy ORM packages will be archived.

Import paths changes

PostgreSQL

  • import { ... } from 'drizzle-orm-pg' -> import { ... } from 'drizzle-orm/pg-core'
  • import { ... } from 'drizzle-orm-pg/node' -> import { ... } from 'drizzle-orm/node-postgres'
  • import { ... } from 'drizzle-orm-pg/neondb' -> import { ... } from 'drizzle-orm/neon'
  • import { ... } from 'drizzle-orm-pg/postgres.js' -> import { ... } from 'drizzle-orm/postgres.js'

MySQL

  • import { ... } from 'drizzle-orm-mysql' -> import { ... } from 'drizzle-orm/mysql-core'
  • import { ... } from 'drizzle-orm-mysql/mysql2' -> import { ... } from 'drizzle-orm/mysql2'

SQLite

  • import { ... } from 'drizzle-orm-sqlite' -> import { ... } from 'drizzle-orm/sqlite-core'
  • import { ... } from 'drizzle-orm-sqlite/better-sqlite3' -> import { ... } from 'drizzle-orm/better-sqlite3'
  • import { ... } from 'drizzle-orm-sqlite/d1' -> import { ... } from 'drizzle-orm/d1'
  • import { ... } from 'drizzle-orm-sqlite/bun' -> import { ... } from 'drizzle-orm/bun-sqlite'
  • import { ... } from 'drizzle-orm-sqlite/sql.js' -> import { ... } from 'drizzle-orm/sql.js'