A lightweight MySQL query builder for Node.js (v2.0.10, last updated 2019). Wraps mysql2 with a simple API for SELECT, INSERT, UPDATE, and DELETE operations with support for read/write splitting, connection pooling, optional big number handling, and timezone configuration. Key differentiator: built-in read-only pool support and automatic NULL handling for undefined fields. Requires Node >=6.0. Release cadence: sporadic, no recent updates.
npm install sy-node-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes sy-node-mysql with a config array (connection pool settings) and demonstrates select, insert, and raw query.
Consider migrating to modern alternatives like knex, typeorm, or mysql2 directly.
Ensure each named db group contains exactly one entry with readonly: false (or omitted default) and any number of readonly replicas.
Always use require('sy-node-mysql') to get constructor, then instantiate: new Mysql(config).Use mysql.query for custom UPSERT statements if needed.
Destructure result: const { count, rows } = await mysql.selectAndCount(...);Ensure you have created an instance: const mysql = new Mysql(config); then call mysql.select(...).
Run 'npm install sy-node-mysql --save' and verify package.json includes it.
Update mysql2 to >=2.0.0 and set mysql2 default auth plugin: alter user 'user'@'host' identified with mysql_native_password by 'password';