using in nest.js
What is the proper way to use in nest.js (or express). Should I create one single instance of db that should be exported (singleton instance), or the db should be created each time when needed?
Is there somewhere a sample code when using with nest ?
1 Reply
yes, it's better to create a singleton
actually, it doesn't make a lot of difference either way, because Drizzle just wraps a connection you provide to it, and the runtime overhead is minuscule