colbustanut
colbustanut
DTDrizzle Team
Created by colbustanut on 9/10/2023 in #help
Journal displays wrong driver (I think)
I've only been using drizzle for a little while and so far it was working great, however when I tried to rebuild my docker container i kept getting some (for me) unexplainable errors. Error: node_modules/drizzle-orm/mysql-core/db.d.ts(1,38): error TS2307: Cannot find module 'mysql2/promise' or its corresponding type declarations. I went and checked where in my project the string 'mysql' was used (maybe I accidentally imported 'drizzle-orm/mysql-core' instead of pg-core'. This wasn't the case and the only file in my project referencing 'mysql' was ./drizzle/meta/_journal.json, it has a first level key 'dialect', which is set to 'mysql'. From what I understand I should NOT alter these files directly since they are generated (right?). There for I checked my 'migrate' command
drizzle-kit generate:pg --config=./drizzle.config.js
drizzle-kit generate:pg --config=./drizzle.config.js
and my drizzle.config.js
import { Config } from "drizzle-kit";

export default {
schema: "./src/db/**/schema.ts",
out: "./drizzle",
driver: 'pg'
}
import { Config } from "drizzle-kit";

export default {
schema: "./src/db/**/schema.ts",
out: "./drizzle",
driver: 'pg'
}
and to apply my migrations I use this import:
import { migrate } from 'drizzle-orm/node-postgres/migrator';
import { migrate } from 'drizzle-orm/node-postgres/migrator';
My questions: - how does the generated dialect end up being 'mysql'? - is this the reason drizzle tries to import 'mysql2/promise'? - is it correct to assume that if I only use postgres, that I do not need the mysql2 packages (or are there some under the hood dependencies)? I hope I have provided enough information for someone to help me out, in any thank you in advance for your reply!
16 replies