drizzle-kit introspect:pg Invalid input Only "pg" is available options for "--driver"

When attempting to introspect a neon pg db, I get a very cryptic message. npx drizzle-kit introspect:pg --connectionString=postgres://gbd:[email protected]/neondb
drizzle-kit: v0.19.9 drizzle-orm: v0.27.2 Invalid input Only "pg" is available options for "--driver"
4 Replies
Adrastus
Adrastus•2y ago
You need add driver and dbCredentials options to drizzle.config.ts
schlabach
schlabach•16mo ago
getting this too even though I have my drizzle.config.ts set
//drizzle.config.ts
import * as dotenv from 'dotenv'
import type { Config } from 'drizzle-kit'

dotenv.config()

export default {
schema: './src/db/schema.ts',
out: './drizzle',
driver: 'pg',
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
} satisfies Config
//drizzle.config.ts
import * as dotenv from 'dotenv'
import type { Config } from 'drizzle-kit'

dotenv.config()

export default {
schema: './src/db/schema.ts',
out: './drizzle',
driver: 'pg',
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
} satisfies Config
frankscp
frankscp•13mo ago
I was having the exact same issue. I managed to solve it by using credentials instead of the connection string:
import type { Config } from "drizzle-kit";

export default {
schema: "./src/schema/*",
out: "./drizzle",
driver: 'pg',
dbCredentials: {
user: "postgres",
password: "password",
host: "127.0.0.1",
port: 5432,
database: "db",
}
} satisfies Config;
import type { Config } from "drizzle-kit";

export default {
schema: "./src/schema/*",
out: "./drizzle",
driver: 'pg',
dbCredentials: {
user: "postgres",
password: "password",
host: "127.0.0.1",
port: 5432,
database: "db",
}
} satisfies Config;
Mindaugas
Mindaugas•12mo ago
just add --driver: pg. It's a bug in docs.
Want results from more Discord servers?
Add your server