src/content/docs/latest-releases/drizzle-orm-v0308.mdx
import { pgSchema } from 'drizzle-orm/pg-core';
const mySchema = pgSchema('mySchema');
const colors = mySchema.enum('colors', ['red', 'green', 'blue']);
Learn more about Postgres schemas and enums.
migrate() function to use batch API (#2137)To get started with Drizzle and D1 follow the documentation.
where clause in Postgres .onConflictDoUpdate method into setWhere and targetWhere clauses, to support both where cases in on conflict ... clause (fixes #1628, #1302 via #2056).await db.insert(employees)
.values({ employeeId: 123, name: 'John Doe' })
.onConflictDoUpdate({
target: employees.employeeId,
targetWhere: sql`name <> 'John Doe'`,
set: { name: sql`excluded.name` }
});
await db.insert(employees)
.values({ employeeId: 123, name: 'John Doe' })
.onConflictDoUpdate({
target: employees.employeeId,
set: { name: 'John Doe' },
setWhere: sql`name <> 'John Doe'`
});
Learn more about .onConflictDoUpdate method here.
where clause in Postgres .onConflictDoNothing method, as it was placed in a wrong spot (fixes #1628 via #2056).Learn more about .onConflictDoNothing method here.
To get started with Drizzle and AWS Data API follow the documentation.