【发布时间】:2011-10-07 13:19:59
【问题描述】:
我正在使用 node-mysql 模块 (https://github.com/felixge/node-mysql) 或 (http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/) 。
这个 API 也处理连接池吗?
我的意思是对于每个用户请求,我都会调用 Client.connect() 来查询 MySQL 并释放连接:Client.end()。
这是正确的方法,还是我应该在代码中只连接/断开一次。
我正在学习这个文档:https://github.com/felixge/node-mysql/blob/master/Readme.md
【问题讨论】:
标签: mysql database node.js connection-pooling