Skip to main content

文档

¥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:


示例

¥Examples

请检查这些 MySQL2 的 examples

¥Please check these examples for MySQL2.


已知与 [Node MySQL][node-mysql] 不兼容

¥Known incompatibilities with Node MySQL

  • zeroFill 标志在类型转换中被忽略。如果这对你很重要,你需要检查相应字段的 zeroFill 标志并手动转换为字符串。

    ¥zeroFill flag 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.

  • 除非你传递此配置选项,否则 DECIMALNEWDECIMAL 类型始终返回为 string

    ¥DECIMAL and NEWDECIMAL types always returned as string unless 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 JSON type is always returned parsed into an object. However, you can modify this behavior by specifying the following configuration:

{
jsonStrings: true,
}

其他资源

¥Other Resources


基准

¥Benchmarks