Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

没有断开 mysql连接 的方法吗? #23

Closed
gakkiox opened this issue Jan 6, 2023 · 1 comment
Closed

没有断开 mysql连接 的方法吗? #23

gakkiox opened this issue Jan 6, 2023 · 1 comment

Comments

@gakkiox
Copy link

gakkiox commented Jan 6, 2023

大佬,没有断开 此次mysql连接 的方法吗?

@liuhuisheng
Copy link
Owner

liuhuisheng commented Feb 9, 2023

底层采用的是连接池的方案,无需对连接进行操作,https://github.com/mysqljs/mysql#pooling-connections, 每次查询等价于:pool.getConnection() -> connection.query() -> connection.release(),如果你要销毁连接池的话可以调用pool.end()但是没必要,连接池pool对象可以在db.provider.command.mysql对象中取到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants