node-mysql 2.0.0-alpha9 发布,改进内容包括:
Add query to pool to execute queries directly using the pool
Pool option to set queue limit
Pool sends 'connection' event when it opens a new connection
Added stringifyObjects option to treat input as strings rather than objects (#501)
Support for poolClusters
Datetime improvements
Bug fixes
node.js mysql 驱动库,示例代码:
01 var mysql = require('mysql');
02 var connection = mysql.createConnection({
03 host : 'localhost',
04 user : 'me',
05 password : 'secret',
06 });
07
08 connection.connect();
09
10 connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
11 if (err) throw err;
12
13 console.log('The solution is: ', rows[0].solution);
14 });
15
16 connection.end();
思朴互联-西部数码代理站
2013-8-28