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


coming from - https://github.com/drizzle-team/drizzle-orm/blob/33f0374e29014677c29f4b1f1dd1ab8fb68ac516/drizzle-orm/src/pg-core/columns/jsonb.ts#L42-L44
GitHub
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
Was this page helpful?