-
-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #778 from drizzle-team/beta
Beta
- Loading branch information
Showing
189 changed files
with
3,477 additions
and
1,394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## Correct behavior when installed in a monorepo (multiple Drizzle instances) | ||
|
||
Replacing all `instanceof` statements with a custom `is()` function allowed us to handle multiple Drizzle packages interacting properly. | ||
|
||
**It also fixes one of our biggest Discord tickets: `maximum call stack exceeded` 🎉** | ||
|
||
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' | ||
|
||
if (is(value, Column)) { | ||
// value's type is narrowed to Column | ||
} | ||
``` | ||
|
||
## `distinct` clause support | ||
|
||
```ts | ||
await db.selectDistinct().from(usersDistinctTable).orderBy( | ||
usersDistinctTable.id, | ||
usersDistinctTable.name, | ||
); | ||
``` | ||
|
||
Also, `distinct on` clause is available for PostgreSQL: | ||
|
||
```ts | ||
await db.selectDistinctOn([usersDistinctTable.id]).from(usersDistinctTable).orderBy( | ||
usersDistinctTable.id, | ||
); | ||
|
||
await db.selectDistinctOn([usersDistinctTable.name], { name: usersDistinctTable.name }).from( | ||
usersDistinctTable, | ||
).orderBy(usersDistinctTable.name); | ||
``` | ||
|
||
## `bigint` and `boolean` support for SQLite | ||
|
||
Contributed by @MrRahulRamkumar (#558), @raducristianpopa (#411) and @meech-ward (#725) | ||
|
||
```ts | ||
const users = sqliteTable('users', { | ||
bigintCol: blob('bigint', { mode: 'bigint' }).notNull(), | ||
boolCol: integer('bool', { mode: 'boolean' }).notNull(), | ||
}); | ||
``` | ||
|
||
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fixed drizzle-zod not enforcing string lengths (#691) by @TiltedToast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.