[BUG]: drizzle-kit push stuck at "Pulling schema from database..." / not detecting "dialect"
What version of drizzle-orm are you using?
0.31.2
What version of drizzle-kit are you using?
0.22.8
Describe the Bug
I have a setup that connects to a Supabase Postgres database.
When I run npx drizzle-kit push it hangs at "Pulling schema from database...":
When I run npx drizzle-kit push --verbose I get this error:
const error2 = new ZodError(ctx.common.issues);
^
_ZodError: [
{
"expected": "'postgresql' | 'mysql' | 'sqlite'",
"received": "undefined",
"code": "invalid_type",
"path": [
"dialect"
],
"message": "Required"
}
]
at get error (D:\repos\-----\-------api\node_modules\drizzle-kit\bin.cjs:5183:28)
at _ZodObject.parse (D:\repos\------\-------api\node_modules\drizzle-kit\bin.cjs:5263:22)
at preparePushConfig (D:\repos\------\-------api\node_modules\drizzle-kit\bin.cjs:20208:33)
at _Command.<anonymous> (D:\repos\------\-------api\node_modules\drizzle-kit\bin.cjs:129662:13) {
issues: [
{
expected: "'postgresql' | 'mysql' | 'sqlite'",
received: 'undefined',
code: 'invalid_type',
path: [ 'dialect' ],
message: 'Required'
}
],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
errors: [
{
expected: "'postgresql' | 'mysql' | 'sqlite'",
{
expected: "'postgresql' | 'mysql' | 'sqlite'",
received: 'undefined',
code: 'invalid_type',
path: [ 'dialect' ],
message: 'Required'
}
]
}
{
expected: "'postgresql' | 'mysql' | 'sqlite'",
received: 'undefined',
{
{
expected: "'postgresql' | 'mysql' | 'sqlite'",
received: 'undefined',
code: 'invalid_type',
path: [ 'dialect' ],
message: 'Required'
}
]
}
@daneus I have the same problem, did you solve yours?
bernhardw
the only solution I found was to save my supabase data as .csv on the dashboard, nuke the database including tables, and rerun the push command and then it would work, then just had to refill my tables with the .csv files
@bernhardw, were you able to resolve this, i just came across this same error
I am getting a similar issue. Fresh Supabase project, fresh latest repo using t3-turbo and stuck on "Pulling Schema" for like 15mins and no errors
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgres
then changing it back after a finished db push
I'm currently having the same problem, pushing only works after wiping the entire database. Is there any update on a solution that doesn't require changing the connection string?
Same here, also verbose is not displaying anything. It just hang there forever.
No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/.../drizzle.config.ts'
Using 'postgres' driver for database querying
[⣽] Pulling schema from database...
Versions:
drizzle-kit: v0.30.1
drizzle-orm: v0.38.3
+1
+1
Getting the same error at latest drizzle-kit version, although the work around by @63r6o works, its quite frustrating, what might be causing this?
+1
the only thing that worked for me was:
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgresthen changing it back after a finished db push
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgresthen changing it back after a finished db push
Thanks. Tried it and it worked. Though to be honest I abandoned project for a month and just continued today with new tables.
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgresthen changing it back after a finished db push
2025 this still works
+1
+1
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgresthen changing it back after a finished db push
this solution still works
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgresthen changing it back after a finished db push
@63r6o this worked for me. Seeing as how we're still having this issue, I'd suggest the Supabase team re-open the issue.
a temporary fix what is worked for me is to change the port to 5432 (supavisor session) instead of 6543 in the connection string, like this:
postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-0-ca-central-1.pooler.supabase.com:5432/postgresthen changing it back after a finished db push
Thank you bro, it worked for me (March 2025)
@daneus I see that you closed the issue, could you re-open?