Issue Pushing Schema to Turso

Hi All, I made a schema.ts with sqliteTable statements, and I created a drizzle.config.ts as follows:
import { Config } from "drizzle-kit";

export default {
driver: "turso",
dbCredentials: {
url: "libsql://[TABLE]-[GITHUB].turso.io",
authToken:
"[TOKEN]",
},
schema: "./schema.ts",
out: "./out",
} as Config;
import { Config } from "drizzle-kit";

export default {
driver: "turso",
dbCredentials: {
url: "libsql://[TABLE]-[GITHUB].turso.io",
authToken:
"[TOKEN]",
},
schema: "./schema.ts",
out: "./out",
} as Config;
And when I try running pnpm drizzle-kit push:sqlite, I get the following error regarding that it cannot find module better-sqlite3:
drizzle-kit: v0.19.13
drizzle-orm: v0.28.6

node:internal/modules/cjs/loader:1048
const err = new Error(message);
^

Error: Cannot find module 'better-sqlite3'
Require stack:
- /workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs
at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:43596:37)
at __init (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:9:56)
at node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/index.js (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:51852:5)
at __init (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:9:56)
at src/cli/commands/sqliteIntrospect.ts (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:51875:5)
at __init (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:9:56) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs'
]
}
drizzle-kit: v0.19.13
drizzle-orm: v0.28.6

node:internal/modules/cjs/loader:1048
const err = new Error(message);
^

Error: Cannot find module 'better-sqlite3'
Require stack:
- /workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs
at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:43596:37)
at __init (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:9:56)
at node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/index.js (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:51852:5)
at __init (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:9:56)
at src/cli/commands/sqliteIntrospect.ts (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:51875:5)
at __init (/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:9:56) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/workspaces/reserve-power/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs'
]
}
Am I not pushing the schema properly with the command drizzle-kit push:sqlite? Thank you!
2 Replies
Nicolas
NicolasOP14mo ago
I fixed it by installing better-sqlite3, but not sure if this is something that the user should have to do? As that should be a dependency by drizzle and could cause conflicts possibly?
diurivj
diurivj14mo ago
Did you install this on your machine?
Want results from more Discord servers?
Add your server