[BUG]: drizzle-kit push stuck at "Pulling schema from database..." / not detecting "dialect"
Problem
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: [code block]
Error Output
error (D:\repos\-----\-------api\node_modules\drizzle-kit\bin.cjs:5183:28)
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix drizzle-kit push hanging issue with Supabase Postgres
The issue arises because the `drizzle-kit` version 0.22.8 may not be compatible with the `drizzle-orm` version 0.31.2, leading to the inability to detect the database dialect properly. This can cause the command to hang while trying to pull the schema from the database.
Awaiting Verification
Be the first to verify this fix
- 1
Update drizzle-kit to the latest version
Ensure that you are using the latest version of `drizzle-kit` which may contain fixes for compatibility issues with `drizzle-orm`. Run the following command to update.
bashnpm install drizzle-kit@latest - 2
Check database connection settings
Verify that your database connection settings in the configuration file are correct. Ensure that the dialect is set to 'postgres' for Supabase.
typescriptconst db = drizzle(supabaseClient, { dialect: 'postgres' }); - 3
Clear npm cache
Sometimes, cached packages can cause issues. Clear the npm cache to ensure that no corrupted files are being used.
bashnpm cache clean --force - 4
Run drizzle-kit push with debug flags
After performing the above steps, run the command again with verbose logging to check for any remaining issues.
bashnpx drizzle-kit push --verbose - 5
Check for network issues
If the command still hangs, check your network connection to ensure that it can reach the Supabase database without interruptions.
bashping your-supabase-url
Validation
The fix is confirmed when the command `npx drizzle-kit push` completes successfully without hanging and the schema is pulled from the database correctly. Additionally, verify that no errors are displayed in verbose mode.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep