Skip to content

Commit

Permalink
Update changelog, bump drizzle-zod version
Browse files Browse the repository at this point in the history
  • Loading branch information
dankochetov committed Jun 16, 2023
1 parent 33d956c commit bc04f91
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
45 changes: 24 additions & 21 deletions changelogs/drizzle-orm/0.27.0.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
# New Features
## Correct behavior when installed in a monorepo (multiple Drizzle instances)

## Possibility to use multiple drizzle packages in a monorepo
Replacing all `instanceof` statements with a custom `is()` function allowed us to handle multiple Drizzle packages interacting properly.

By replacing all `instanceof` statements with a custom `is()` function, it helped us handle multiple drizzle packages properly and treat them as one. So if you use them interchangeably, you will still have functional drizzle queries.
**It also fixes one of our biggest Discord tickets: `maximum call stack exceeded` 🎉**

> It also fixes one of the biggest discord tickets: `maximum call stack exceeded` 🎉
You can also use this function to check if specific objects are instances of specific drizzle types. It's usable if you are building anything on top of drizzle api
You should now use `is()` instead of `instanceof` to check if specific objects are instances of specific Drizzle types. It might be useful if you are building something on top of the Drizzle API.

```ts
import { is, Column } from 'drizzle-orm'

is(value, Column)
if (is(value, Column)) {
// value's type is narrowed to Column
}
```

## `distinct` statement is now available for all supported dialects

**Usage example**
## `distinct` clause support

```ts
await db.selectDistinct().from(usersDistinctTable).orderBy(
usersDistinctTable.id,
usersDistinctTable.name,
usersDistinctTable.id,
usersDistinctTable.name,
);
```

- `distinct on` statement is now available for all supported dialects

**Usage example**
Also, `distinct on` clause is available for PostgreSQL:

```ts
await db.selectDistinctOn([usersDistinctTable.id]).from(usersDistinctTable).orderBy(
Expand All @@ -39,17 +35,24 @@ await db.selectDistinctOn([usersDistinctTable.name], { name: usersDistinctTable.
).orderBy(usersDistinctTable.name);
```

## New `bigint` mode for SQLite
## `bigint` and `boolean` support for SQLite

thanks @MrRahulRamkumar

**Usage example**
Contributed by @MrRahulRamkumar (#558), @raducristianpopa (#411) and @meech-ward (#725)

```ts
const users = sqliteTable('users', {
blobBigInt: blob('blob', { mode: 'bigint' }).notNull(),
bigintCol: blob('bigint', { mode: 'bigint' }).notNull(),
boolCol: integer('bool', { mode: 'boolean' }).notNull(),
});
```

# Drizzle Kit release
## DX improvements

- Added verbose type error when relational queries are used on a database type without a schema generic
- Fix `where` callback in RQB for tables without relations

## Various docs improvements

- Fix joins docs typo (#522) by @arjunyel
- Add Supabase guide to readme (#690) by @saltcod
- Make the column type in sqlite clearer (#717) by @shairez
1 change: 1 addition & 0 deletions changelogs/drizzle-zod/0.4.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed drizzle-zod not enforcing string lengths (#691) by @TiltedToast
2 changes: 1 addition & 1 deletion drizzle-zod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "drizzle-zod",
"version": "0.4.3",
"version": "0.4.4",
"description": "Generate Zod schemas from Drizzle ORM schemas",
"type": "module",
"scripts": {
Expand Down

0 comments on commit bc04f91

Please sign in to comment.