migrate function hangs without any result
I have this in my
migrate.js
file
when I run the file with bun everything hangs and nothing get's executed, the log functions log the correct credentials and file path but the execution stops after the migrate call, it hangs longer than the timeout so I don't think it is a database issue7 Replies
Also nothing is added to the database
The same thing is also happening when trying to insert with drizzle
When I set logger to true I get the query and everything looks ok in the query but it still hangs
studio runs as expected using the same credentials
I also verified all the values are correct
I haven't seen anything like this. Can you put together and share a minimal reproduction repo?
@Angelelz Here you go
https://github.com/isaacfink/drizzle-bug
I just tested it on my local database instead of rds and it is still not working, run the
db:migrations:generate
command with bun than try running bun ./migrate.js
you can see the credentials in the console so you can make sue everything else is in orderGitHub
GitHub - isaacfink/drizzle-bug
Contribute to isaacfink/drizzle-bug development by creating an account on GitHub.
I am using ssl in the repo but I have tried with and without, for thenrds one in my original project it is a requirement
The repo already has a migration
Did this work before? Have you tried with pnpm/npm/yarn?
Well, I looked into it. I don't think that drizzle is the problem
Is not like I figured it out
but I found that changing type to module and then using postgres-js as the driver, seems to work
This worked for me:
But I had to set esModuleInterop to true
I can't change type to module and I am not using typescript so changing any ts settings won't help, its it just the driver?
With this code you don't have to change it to type: module
But you'll need esModuleInterop: true
I honestly didn't look at why it's not working, I just tested different setups and found what works