文档
¥Documentation
MySQL2 旨在成为 Node MySQL 的替代品。
¥MySQL2 aims to be a drop in replacement for Node MySQL.
如果你发现任何与 Node MySQL 不兼容的 API,请通过 github 问题报告。
¥If you see any API incompatibilities with Node MySQL, please report via github issue.
MySQL2 不仅比 Node MySQL 提供更好的性能,我们还支持以下附加功能:
¥Not only MySQL2 offers better performance over Node MySQL, we also support these additional features:
- 
池化 ¥Pooling 
- 
MySQL 压缩 ¥MySQL Compression 
- 
二进制日志协议客户端 ¥Binary Log Protocol Client 
示例
¥Examples
请检查这些 MySQL2 的 examples。
¥Please check these examples for MySQL2.
已知与 [Node MySQL][node-mysql] 不兼容
¥Known incompatibilities with Node MySQL
- 
zeroFill标志在类型转换中被忽略。如果这对你很重要,你需要检查相应字段的 zeroFill 标志并手动转换为字符串。¥ zeroFillflag is ignored in type conversion. You need to check corresponding field's zeroFill flag and convert to string manually if this is of importance to you.
- 
除非你传递此配置选项,否则 DECIMAL和NEWDECIMAL类型始终返回为string:¥ DECIMALandNEWDECIMALtypes always returned asstringunless you pass this config option:
{
  decimalNumbers: true,
}
由于 Javascript Number 是浮点数,因此此选项可能会丢失数字的精度!
¥This option could lose precision on the number as Javascript Number is a Float!
- 
默认情况下, JSON类型始终解析为对象返回。但是,你可以通过指定以下配置来修改此行为:¥By default, the JSONtype is always returned parsed into an object. However, you can modify this behavior by specifying the following configuration:
{
  jsonStrings: true,
}
其他资源
¥Other Resources
- 
Node MySQL - 最流行的 node.js mysql 客户端库 ¥Node MySQL - Most popular node.js mysql client library 
- 
node-mariasql - 绑定到 libmariasql。最快的客户端之一 ¥node-mariasql - Bindings to libmariasql. One of the fastest clients 
- 
node-libmysqlclient - 绑定到 libmysqlclient ¥node-libmysqlclient - Bindings to libmysqlclient 
- 
go-mysql - MySQL Go 客户端(准备好的语句、binlog 协议、服务器) ¥go-mysql - MySQL Go client (prepared statements, binlog protocol, server) 
基准
¥Benchmarks
- 
npm run benchmarks
- 
尝试在你的系统上运行示例 benchmarks ¥try to run example benchmarks on your system