Running `drizzle-kit introspect:pg` returns "client password must be a string"
I'm attempting to move from objection.js+knex.js over to Drizzle and I'm running
drizzle-kit introspect:pg
against my database but I'm getting the error:
Here's my drizzle.config.ts
:
If i change connectionString: 'DATABASE_URL',
to connectionString: process.env.DATABASE_URL
, I get the error:
I've also tried to specify all the information in my connection string in the CLI params like drizzle-kit instropect:pg --host=... --user=... --password...
but get the same error.
Any help would be appreciated. Thanks in advance.4 Replies
Also worth noting I have a
.env
in the root of my project with:
Update:
hardcoding the user, host, password, database into drizzle.config.ts
seems to have allowed it to run successfully... seems ok because it's just a one-time run and the code won't be checked in, only the migration and schema files but maybe there's a bug in reading the configPlacing
.env
file on its own won't do anything - it's just a file
You need something like dotenv
in the Drizzle config to import values from it as environment variablessame problem
postgres://postgres:postgres@localhost:5432/postgres
fixed password add forgot 😄