You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not properly handling default value on column of type _jsonb, an array of jsonb in postgres.
CREATETABLEpublic.deleteme (
column1 json DEFAULT '{}'::json NOT NULL,
column2 jsonb DEFAULT '[]'::jsonb NOT NULL,
column3 _jsonb DEFAULT ARRAY[]::jsonb[] NOT NULL
);
drizzle-kit pull
SyntaxError: Unexpected token 'R', "RAY" is not valid JSON
at JSON.parse (<anonymous>)
at /Users/brandon.lavigne/git/example/packages/orm/node_modules/drizzle-kit/bin.cjs:19353:66
at Array.map (<anonymous>)
at defaultForColumn (/Users/brandon.lavigne/git/example/packages/orm/node_modules/drizzle-kit/bin.cjs:19342:74)
at /Users/brandon.lavigne/git/example/packages/orm/node_modules/drizzle-kit/bin.cjs:19111:36
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Expected behavior
Instrospection to set the default sql value explicitly. Something like:
@L-Mario564 Getting the same issue, using a database that was set up before trying out drizzle. I'd like to use pull to introspect the database but if fails at the default.
My default value in for one of my columns is ARRAY['{"type": "paragraph", "children": [{"text": ""}]}'::jsonb]. I'm not sure it's possible to write this default using curly brace notation instead of ARRAY[] notation. Using ARRAY[...] is a typical way that default array values will be set in a database, so it would be great if drizzle supported this.
@L-Mario564 Getting the same issue, using a database that was set up before trying out drizzle. I'd like to use pull to introspect the database but if fails at the default.
My default value in for one of my columns is ARRAY['{"type": "paragraph", "children": [{"text": ""}]}'::jsonb]. I'm not sure it's possible to write this default using curly brace notation instead of ARRAY[] notation. Using ARRAY[...] is a typical way that default array values will be set in a database, so it would be great if drizzle supported this.
Same issue here. Facing this on an existing db. Did you find a quick fix?
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
Not properly handling default value on column of type _jsonb, an array of jsonb in postgres.
Expected behavior
Instrospection to set the default sql value explicitly. Something like:
Environment & setup
local macos
The text was updated successfully, but these errors were encountered: