-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'drizzle-seed/studio' of https://github.com/drizzle-team…
…/drizzle-orm into drizzle-seed/studio
- Loading branch information
Showing
37 changed files
with
2,399 additions
and
350 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fix incorrect deprecation detection for table declarations |
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,25 @@ | ||
# Added support for SingleStore dialect | ||
|
||
```ts | ||
import { singlestoreTable, text, int } from 'drizzle-orm/singlestore-core'; | ||
import { createSelectSchema } from 'drizzle-typebox'; | ||
import { Value } from '@sinclair/typebox/value'; | ||
|
||
const users = singlestoreTable('users', { | ||
id: int().primaryKey(), | ||
name: text().notNull(), | ||
age: int().notNull() | ||
}); | ||
|
||
const userSelectSchema = createSelectSchema(users); | ||
|
||
const rows = await db.select({ id: users.id, name: users.name }).from(users).limit(1); | ||
const parsed: { id: number; name: string; age: number } = Value.Parse(userSelectSchema, rows[0]); // Error: `age` is not returned in the above query | ||
|
||
const rows = await db.select().from(users).limit(1); | ||
const parsed: { id: number; name: string; age: number } = Value.Parse(userSelectSchema, rows[0]); // Will parse successfully | ||
``` | ||
|
||
# Bug fixes | ||
|
||
- [[BUG]: drizzle-typebox infers integer() as TString](https://github.com/drizzle-team/drizzle-orm/issues/3756) |
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,23 @@ | ||
# Added support for SingleStore dialect | ||
|
||
```ts | ||
import { singlestoreTable, text, int } from 'drizzle-orm/singlestore-core'; | ||
import { createSelectSchema } from 'drizzle-valibot'; | ||
import { parse } from 'valibot'; | ||
|
||
const users = singlestoreTable('users', { | ||
id: int().primaryKey(), | ||
name: text().notNull(), | ||
age: int().notNull() | ||
}); | ||
|
||
const userSelectSchema = createSelectSchema(users); | ||
const rows = await db.select({ id: users.id, name: users.name }).from(users).limit(1); | ||
const parsed: { id: number; name: string; age: number } = parse(userSelectSchema, rows[0]); // Error: `age` is not returned in the above query | ||
const rows = await db.select().from(users).limit(1); | ||
const parsed: { id: number; name: string; age: number } = parse(userSelectSchema, rows[0]); // Will parse successfully | ||
``` | ||
|
||
# Bug fixes | ||
|
||
- [[BUG]: drizzle-valibot throws Type instantiation is excessively deep and possibly infinite. for refinements](https://github.com/drizzle-team/drizzle-orm/issues/3751) |
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,26 @@ | ||
# New Features | ||
|
||
## Added support for SingleStore dialect | ||
|
||
```ts | ||
import { singlestoreTable, text, int } from 'drizzle-orm/singlestore-core'; | ||
import { createSelectSchema } from 'drizzle-zod'; | ||
|
||
const users = singlestoreTable('users', { | ||
id: int().primaryKey(), | ||
name: text().notNull(), | ||
age: int().notNull() | ||
}); | ||
|
||
const userSelectSchema = createSelectSchema(users); | ||
const rows = await db.select({ id: users.id, name: users.name }).from(users).limit(1); | ||
const parsed: { id: number; name: string; age: number } = userSelectSchema.parse(rows[0]); // Error: `age` is not returned in the above query | ||
|
||
const rows = await db.select().from(users).limit(1); | ||
const parsed: { id: number; name: string; age: number } = userSelectSchema.parse(rows[0]); // Will parse successfully | ||
``` | ||
|
||
# Bug fixes | ||
|
||
- [[BUG]: refining schema using createSelectSchema is not working with drizzle-kit 0.6.0](https://github.com/drizzle-team/drizzle-orm/issues/3735) | ||
- [[BUG]: drizzle-zod inferring types incorrectly](https://github.com/drizzle-team/drizzle-orm/issues/3734) |
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.