Is the DB Connection always opened in NestJS + TypeORM? Is the DB Connection always opened in NestJS + TypeORM? database database

Is the DB Connection always opened in NestJS + TypeORM?


Question 1: that depend on logic and the context of you application, for me neither are wrong nor right.

Qustion 2: the connection pool will open DB connections as it need them to maximase performance. If you application have concurrent users, it make sense to use many connections to DB. You should delegate the opening and closing of DB connections to the connection pool manager. You can limit the number of connection to the DB thogh (https://github.com/typeorm/typeorm/blob/master/docs/connection-options.md#common-connection-options).

Regards