jsonb with bigint gets "Do not know how to serialize a BigInt"

with a postgres jsonb column that has a bigint in it, when doing and inserts/updates to the column you get the error:
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at PgJsonb.mapToDriverValue
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at PgJsonb.mapToDriverValue
coming from - https://github.com/drizzle-team/drizzle-orm/blob/33f0374e29014677c29f4b1f1dd1ab8fb68ac516/drizzle-orm/src/pg-core/columns/jsonb.ts#L42-L44
GitHub
drizzle-orm/drizzle-orm/src/pg-core/columns/jsonb.ts at 33f0374e290...
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅 - drizzle-team/drizzle-orm
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?