drizzle-team / drizzle-team/drizzle-orm
[BUG]: drizzle-kysely requires inserted JSONB columns to be stringified since 0.33.0
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### What version of `drizzle-orm` are you using?
0.33.0
### What version of `drizzle-kit` are you using?
0.24.2
### Describe the Bug
I'm using drizzle-kysely. Schema is defined in drizzle, and I write my queries using Kysely.
I'm using Postgres.
When I upgraded to 0.33.0, any queries that were inserting a jsonb column broke.
I found that I now have to JSON.stringify the POJO before passing it to the Kysely query.
I didn't have to do that before 0.33.0 and it looks like it's not necessary for a native drizzle query, only when using drizzle-kysely.
Is this by design? Seems like a step backwards.
### Expected behavior
I expected to be able to write:
```javascript
const identity = await db
.insertInto('c_field_definition')
.values({
name: values.name,
type: values.type,
config: values.config, // <-- jsonb column
})
.executeTakeFirstOrThrow()
```
but instead I now have to write:
```javascript
const identity = await db
.insertInto('c_field_definition')
.values({
name: values.name,
type: values.type,
config: JSON.stringify(values.config), // <-- jsonb column
})
.executeTakeFirstOrThrow()
```
### Environment & setup
PostgreSQL via Supabase.
Sveltekit 2 running in dev mode on WSL2
Kysely 0.27.4
Contributor guide
Assessment
This issue has not been assessed yet.