`drizzle push` does not work
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 73
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 129
Description
I am working on a Typescipt application using Doltgres and Drizzle. When inserting a row with an explicit NULL value in a JSONB column using Drizzle ORM and the Node.js pg driver, I get the error `cannot scan NULL into *string`. The same operation works successfully with a Postgres db.
**Environment:**
- doltgres: 0.53.0
- drizzle-orm: 0.44.7
- pg: 8.16.3
**Schema**
```
import { jsonb, pgTable, text } from 'drizzle-orm/pg-core';
export const components = pgTable(
'components',
{
id: text('id').notNull(),
name: text('name'),
description: text('description'),
render: jsonb('render'),
}
);
```
**SQL**:
```
CREATE TABLE "data_components" (
"id" varchar(256) NOT NULL,
"name" varchar(256) NOT NULL,
"description" text NOT NULL,
"render" jsonb,
);
```
**Example**
```
import { Pool } from 'pg';
import { drizzle } from 'drizzle-orm/node-postgres';
const params = {
id: 'test',
render: null,
name: 'Test',
description: test,
};
const pool = new Pool({ connectionString });
const db = drizzle(pool, { schema });
await db
.insert(components)
.values(params)
```
The insert fails with the following error:
```
cause: error: cannot scan NULL into *string
at node_modules/.pnpm/pg-pool@3.10.1_pg@8.16.3/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
```
Contributor guide
Assessment
This issue has not been assessed yet.