nqhtrung
DTDrizzle Team
•Created by Down on 2/7/2025 in #help
when running postgres in docker, drizzle cannot connect to it, says database doesnt exist
have you map localhost to 127.0.0.1?
7 replies
DTDrizzle Team
•Created by nu on 2/5/2025 in #help
Changing postgres timestamp mode (string -> date) isn't reflected in migrations
Date is stored as string in postgres/mysql. The mode: ‘date’ only affects the typescript type. Behind the scene, your data is always saved as string.
4 replies
DTDrizzle Team
•Created by xxxxx on 2/7/2025 in #help
Update returning with some relation
I believe your question is answered here https://www.answeroverflow.com/m/1177544395306827826
As far as I’m concerned, it’s not possible in Postgres (assumed that’s what you’re using). If it can’t be done via native query, it’s not possible in Drizzle
2 replies
DTDrizzle Team
•Created by Down on 2/7/2025 in #help
when running postgres in docker, drizzle cannot connect to it, says database doesnt exist
localhost in docker refers to its own network - the network inside docker container. Instead of using localhost, try to use the container name in docker. Make sure you have all the services in the same network.
It’s worth reading up on docker network for these kinds of issues.
7 replies
DTDrizzle Team
•Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2

13 replies
DTDrizzle Team
•Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2
it’s a problem with hot reload in NextJS. Try using singleton for your connection pool.
13 replies
DTDrizzle Team
•Created by nqhtrung on 1/19/2024 in #help
drizzle infers incorrect type of decimal
Seems like it is a bug and has been reported here
https://github.com/drizzle-team/drizzle-orm/issues/1290
2 replies
DTDrizzle Team
•Created by nqhtrung on 1/10/2024 in #help
Drizzle kit drops and re-adds constraint
I understand that if a schema is not specified, the default one is public, so what's the point of forcing "public" namespace for constraint like this? It would make the migration files huge
2 replies
DTDrizzle Team
•Created by nqhtrung on 12/15/2023 in #help
findFirst should return optional object
Hi, thanks for the response. I just discovered that strictNullChecks should be true. My bad 😥 . Everything is good now! Much appreciated!
4 replies
DTDrizzle Team
•Created by codefork on 8/18/2023 in #help
Get total row count in select
here is how I get total count of the records returned. I also did some pagination here.
7 replies
DTDrizzle Team
•Created by sik on 8/13/2023 in #help
What's the best way to deploy migrations on production database?
Sorry if this is not what you needed, but here is how I handle migration on live production
I create a docker instance and install the bare necessary dependencies just to run the migration script
Here is the Dockerfile
Here is the script section in my package.json
migration.ts is just a ts file where I define my migrate function.
Here is my docker compose file.
This way, every time you run the docker compose, you start the db, the app and THEN the migration will run, the container will automatically shut down when the migration succeeds (or fails). Since migrations are safe to run when they have already been run, we can start migrations every time we start the app.
16 replies