Pavlo Zalutskiy
Pavlo Zalutskiy
DTDrizzle Team
Created by Pavlo Zalutskiy on 6/30/2024 in #help
When use drizzle-kit drop command got an error: Error Please specify 'dialect' param
Hello! I'm working on drizzle/neon setup and at the moment I would like to drop my migrations which is stored inside of this directory:
src/libs/packages/drizzle/migrations
src/libs/packages/drizzle/migrations

Issue: When I've tried the following command:
npx drizzle-kit drop --out=src/libs/packages/drizzle/migrations
npx drizzle-kit drop --out=src/libs/packages/drizzle/migrations
I got this error:
Error Please specify 'dialect' param
Error Please specify 'dialect' param
I don't quite understand what's wrong because this command doesn't have this parameter. I did try to point out the dialect and got the following error:
error: unknown option '--dialect=postgresql'
error: unknown option '--dialect=postgresql'
Here's my drizzle.config.ts file:
import { defineConfig } from "drizzle-kit";
import { config } from "@/libs/packages/config";

const drizzleConfig = defineConfig({
schema: "src/libs/packages/drizzle/schema.ts",
out: "src/libs/packages/drizzle/migrations",
dialect: "postgresql",
dbCredentials: {
url: config.env.NEON_CONNECTION_STRING,
},
verbose: true,
strict: true,
});

export { drizzleConfig };
import { defineConfig } from "drizzle-kit";
import { config } from "@/libs/packages/config";

const drizzleConfig = defineConfig({
schema: "src/libs/packages/drizzle/schema.ts",
out: "src/libs/packages/drizzle/migrations",
dialect: "postgresql",
dbCredentials: {
url: config.env.NEON_CONNECTION_STRING,
},
verbose: true,
strict: true,
});

export { drizzleConfig };
Question: How can I fix it so that drizzle doesn't throw the error about a non-existent parameter? Repository https://github.com/PablloZz/next-express-auth/tree/feat/init-drizzle-neon/backend I will be grateful for any help
1 replies
DTDrizzle Team
Created by Pavlo Zalutskiy on 6/29/2024 in #help
drizzle-kit generate migrations error: Please specify 'dialect' param (dialect param is included)
I would like to generate migrations but when I run the following command:
npx drizzle-kit generate --config drizzle.config.ts --dialect postgresql
npx drizzle-kit generate --config drizzle.config.ts --dialect postgresql
I got this output:
Error Please specify 'dialect' param
Error Please specify 'dialect' param
This is my drizzle.config.ts
import { defineConfig } from "drizzle-kit";
import { config } from "@/libs/packages/config";

const drizzleConfig = defineConfig({
schema: "src/libs/packages/drizzle/schema.ts",
out: "src/libs/packages/drizzle/migrations",
dialect: "postgresql",
dbCredentials: {
url: config.env.NEON_CONNECTION_STRING,
},
verbose: true,
strict: true,
});

export { drizzleConfig };
import { defineConfig } from "drizzle-kit";
import { config } from "@/libs/packages/config";

const drizzleConfig = defineConfig({
schema: "src/libs/packages/drizzle/schema.ts",
out: "src/libs/packages/drizzle/migrations",
dialect: "postgresql",
dbCredentials: {
url: config.env.NEON_CONNECTION_STRING,
},
verbose: true,
strict: true,
});

export { drizzleConfig };
schema.ts
import { pgTable, serial, varchar } from "drizzle-orm/pg-core";

const userTable = pgTable("user", {
id: serial("id").primaryKey(),
name: varchar("name").notNull(),
});

export { userTable };
import { pgTable, serial, varchar } from "drizzle-orm/pg-core";

const userTable = pgTable("user", {
id: serial("id").primaryKey(),
name: varchar("name").notNull(),
});

export { userTable };
2 replies