New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Missing d1 as a valid input for driver #2292
Comments
I'm getting type errors but this at config at least launches for drizzle studio for me
|
Same issue. Here is my setup 👇🏿
// drizzle.config.ts
import { defineConfig } from "drizzle-kit";
export default defineConfig({
schema: "./server/database/schema",
out: "./server/database/migrations",
dialect: "sqlite", // <-- No good, even with this. Is this even required? 🤔
driver: "d1",
dbCredentials: {
wranglerConfigPath: "./wrangler.toml",
dbName: "coolkatznotrealdbname”,
},
});
|
I have the same issue with a barebone setup. @collinstommy approach worked for me with slight adjustments: import { defineConfig } from "drizzle-kit";
const isStudio = process.argv.includes("studio");
// [TODO] Always use "d1" driver when there's a solution for the issue: https://github.com/drizzle-team/drizzle-orm/issues/2292
// driver: "d1",
// dbCredentials: {
// wranglerConfigPath: "./../../apps/web/wrangler.toml",
// dbName: "main",
// },
export default defineConfig({
schema: "./schema.ts",
out: "./drizzle",
dialect: "sqlite",
...(isStudio
? {
driver: "d1-http",
dbCredentials: {
wranglerConfigPath: "./../../apps/web/wrangler.toml",
url: "file:./../../apps/web/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/YOUR_DB_ID.sqlite",
},
}
: {
driver: "d1",
dbCredentials: {
wranglerConfigPath: "./../../apps/web/wrangler.toml",
dbName: "main",
},
}),
}); I added |
This should be fixed in |
Hey @AndriiSherman I am trying with
Also here is the config import { defineConfig } from "drizzle-kit";
export default defineConfig({
schema: "./src/db/schema.ts",
out: "./migrations",
dialect: "sqlite",
driver: "d1",
dbCredentials: {
wranglerConfigPath: "./wrangler.toml",
dbName: "production_db",
},
verbose: true,
strict: true,
schemaFilter: ["public"],
migrations: {
table: "migrations",
schema: "public",
},
}); Apart from generate and check none of the commands like migrate, pull, push, studio seem to work. |
I also can confirm still seeing this @AndriiSherman |
@Akkuma @imumesh18 |
That worked. Yea reloading TS server was the ticket since it still said |
you should have 2 separate drizzle configs for remote and local
|
What version of
drizzle-orm
are you using?0.30.10
What version of
drizzle-kit
are you using?0.21.0
Describe the Bug
Following the documentation for migrating to D1 i'm getting the following error:
Invalid input Either "turso", "libsql", "better-sqlite" are available options for "--driver"
Using this setup:
The text was updated successfully, but these errors were encountered: