Ricardo Romero
Ricardo Romero
Explore posts from servers
DTDrizzle Team
Created by Ricardo Romero on 5/15/2024 in #help
Bigint in SQLite results in "TypeError: Do Not Know how to serialize a BigInt"
It's failing in this section of my schema:
const users = sqliteTable("users", {
balance: blob("balance", { mode: "bigint" }).notNull().default(BigInt(0)),
id: text("id", { mode: "text" }).unique().notNull().primaryKey(),
});
const users = sqliteTable("users", {
balance: blob("balance", { mode: "bigint" }).notNull().default(BigInt(0)),
id: text("id", { mode: "text" }).unique().notNull().primaryKey(),
});
With the following error:
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at applyJsonDiff (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:5573:27)
at applySnapshotsDiff (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:17562:20)
at prepareSQL (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:15220:20)
at prepareAndMigrateSqlite (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:15163:48)
at async Command.<anonymous> (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:66406:3)
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at applyJsonDiff (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:5573:27)
at applySnapshotsDiff (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:17562:20)
at prepareSQL (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:15220:20)
at prepareAndMigrateSqlite (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:15163:48)
at async Command.<anonymous> (/Users/moro/semiotic/sql-studio-webapp/node_modules/drizzle-kit/bin.cjs:66406:3)
When I try to run drizzle-kit generate:sqlite.
6 replies
DTDrizzle Team
Created by Ricardo Romero on 3/25/2024 in #help
How to use vercel postgres in localhost?
I have set up drizzle according to the docs, and can use drizzle kit to run migrations alright. (I have seen the tables created in vercel dashboard). Still, when I try to use any drizzle functions in my sveltekit app, I get a websocket error. Any idea what I need to do to get vercel-postgres working? Here's the relevant code and errors:
5 replies