简体   繁体   中英

How to Set typeorm connection pool size in Nestjs? (MySQL)

I saw this link create connection pool TypeOrm

This article explained

"extra": {
  "connectionLimit": 5
}

But I thought that this is just max limit of connection instead of creating connection pool in advance

How can I create typeorm(mysql) connection pool in Nestjs?

From the words of one of the authors:

TypeORM creates a connection pool and uses connection for a single operation (find, save, remove, etc.) - it takes the connection, uses it and releases it. That's it. If all connections are busy it waits until any of them is released and then use it.

If you want your pool to have a max size, then extra.connectionLimit is the way to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM