nightire
nightire
DTDrizzle Team
Created by nightire on 12/7/2023 in #help
define a jsonb column with `{}` as default value does not work
I'm trying to define a jsonb column with default value like this:
attrs: pg
.jsonb('attrs')
.$type<Record<string, JSONValue>>()
.default(sql`'{}'::jsonb`),
attrs: pg
.jsonb('attrs')
.$type<Record<string, JSONValue>>()
.default(sql`'{}'::jsonb`),
however, the inferred type definition of attrs still be Record<string, JSONValue> | null. How to get rid of the null?
5 replies