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 };
1 Reply
Pavlo Zalutskiy
Pavlo ZalutskiyOP6mo ago
Solved it by specifying the schema parameter directly in the command:
npx drizzle-kit generate --dialect=postgresql --schema=src/libs/packages/drizzle/schema.ts
npx drizzle-kit generate --dialect=postgresql --schema=src/libs/packages/drizzle/schema.ts
Want results from more Discord servers?
Add your server