Singodimejo
Singodimejo
DTDrizzle Team
Created by Singodimejo on 8/16/2024 in #help
problems with config file dialect for PostgreSQL
versions: drizzle-orm: 0.32.2 drizzle-kit: 0.23.2 I have something like this for my config file:
import 'dotenv/config';
import type { Config } from 'drizzle-kit';

const {
PGUSER,
PGPASSWORD,
PGHOST,
PGPORT,
PGDATABASE
} = process.env

export default {
schema: './src/lib/db/drizzle/schema.ts',
out: './src/lib/db/drizzle',
dialect: 'postgresql',
dbCredentials: {
user: String(PGUSER),
password: String(PGPASSWORD),
host: String(PGHOST),
port: Number(PGPORT),
database: String(PGDATABASE)
},
verbose: true,
strict: true
} satisfies Config
import 'dotenv/config';
import type { Config } from 'drizzle-kit';

const {
PGUSER,
PGPASSWORD,
PGHOST,
PGPORT,
PGDATABASE
} = process.env

export default {
schema: './src/lib/db/drizzle/schema.ts',
out: './src/lib/db/drizzle',
dialect: 'postgresql',
dbCredentials: {
user: String(PGUSER),
password: String(PGPASSWORD),
host: String(PGHOST),
port: Number(PGPORT),
database: String(PGDATABASE)
},
verbose: true,
strict: true
} satisfies Config
and when I try to use this config file, say for the introspect command of drizzle-kit, I get an error that says this:
No config path provided, using default 'drizzle.config.ts'
Reading config file '[path_to_project_root]\drizzle.config.ts'
Error Please provide required params:
[✓] dialect: 'postgresql'
No config path provided, using default 'drizzle.config.ts'
Reading config file '[path_to_project_root]\drizzle.config.ts'
Error Please provide required params:
[✓] dialect: 'postgresql'
which is clearly available in my config file. However, if I change the dbCredential to use a URL string with a template string to use my environment variables, it works just fine. So what's the issue here? side note I execute drizzle-kit using pnpm exec since I use pnpm on this project.
18 replies