API 和配置
¥API and Configuration
MySQL2 的 API 大多与 Node MySQL 兼容。
¥MySQL2 is mostly API compatible with Node MySQL.
一个已知的不兼容性是 DECIMAL
值以字符串形式返回,而在 Node MySQL 中它们以数字形式返回。这包括将 SUM()
和 AVG()
函数应用于 INTEGER
参数时的结果。这样做是故意的,以避免精度损失 - 参见 https://github.com/sidorares/node-mysql2/issues/935。
¥One known incompatibility is that DECIMAL
values are returned as strings whereas in Node MySQL they are returned as numbers. This includes the result of SUM()
and AVG()
functions when applied to INTEGER
arguments. This is done deliberately to avoid loss of precision - see https://github.com/sidorares/node-mysql2/issues/935.
如果你发现与 Node MySQL 的任何其他不兼容问题,请通过问题跟踪器报告。我们将优先修复报告的不兼容性。
¥If you find any other incompatibility with Node MySQL, Please report via Issue tracker. We will fix reported incompatibility on priority basis.