nqhtrung
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
DTDrizzle Team
•Created by codefork on 8/18/2023 in #help
Get total row count in select
I ran into same issue and using extras doesn’t work, I have to use the regular CRUD api
7 replies
DTDrizzle Team
•Created by nqhtrung on 8/4/2023 in #help
How to implement interface for table?
This, I’m working in a monorepo where I have a module for Web, one for API and one for shared interface. The workflow is I first create an interface in the shared interface module then use it in both web and api modules. This way I can make sure the api returns the correct type for the web.
5 replies