日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

easy mysql_GitHub - aleafs/easymysql: mysql client in cluster, based on node-mysql

發布時間:2023/12/15 数据库 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 easy mysql_GitHub - aleafs/easymysql: mysql client in cluster, based on node-mysql 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Click

About

easymysql 基于node-mysql 開發而來,提供一個簡單、高可用的mysql連接基礎庫。主要特性如下:

支持query超時控制;

可控制的連接池支持,SQL總是盡可能早地被 可用的 空閑連接搶到并執行;

支持master-slave模式,基于SHOW VARIABLES LIKE 'READ_ONLY'方式自動判斷主庫和從庫,運行期間自動感知主從切換;

即將支持事務。

Install

$ npm install easymysql

Usage

var Client = require('easymysql');

var mysql = Client.create({

'maxconnections' : 10

});

mysql.addserver({

'host' : '127.0.0.1',

'user' : 'write_user',

'password' : ''

});

mysql.addserver({

'host' : '127.0.0.1',

'user' : 'read_user',

'password' : ''

});

mysql.on('busy', function (queuesize, maxconnections, which) {

// XXX: write log and monitor it

});

mysql.query('SHOW DATABASES', function (error, res) {

console.log(res);

});

// bind params

mysql.query({

sql: 'select * from user where user =:user',

params: {user: 'xxoo'}

}, function (err, rows) {

console.log(rows);

});

Contributors

project: easymysql

commits: 161

files : 16

authors:

135aleafs 83.9%

21zhaolei 13.0%

4tangyao 2.5%

1紫胤 0.6%

License

(The MIT License)

Copyright (c) 2012 aleafs and other easymysql contributors

Permission is hereby granted, free of charge, to any person obtaining

a copy of this software and associated documentation files (the

'Software'), to deal in the Software without restriction, including

without limitation the rights to use, copy, modify, merge, publish,

distribute, sublicense, and/or sell copies of the Software, and to

permit persons to whom the Software is furnished to do so, subject to

the following conditions:

The above copyright notice and this permission notice shall be

included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,

EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF

MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY

CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,

TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE

SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

總結

以上是生活随笔為你收集整理的easy mysql_GitHub - aleafs/easymysql: mysql client in cluster, based on node-mysql的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。