A promise-based wrapper around the mysqljs/mysql library providing connection pooling with master-slave replication support. Current stable version is 1.0.17. Release cadence is low. Key differentiators include simplified failover between master and slave databases and helper methods like queryObject, executeInsert, and executeUpdate that return parsed results directly. It targets Node.js environments and assumes mysqljs/mysql is already installed.
npm install hi-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import, create a pool with configuration from environment variables, run query and queryObject, then close pool.
Pass a single object or an array with at least one element (master).
Switch to mysql2 wrapper like 'mysql2/promise' or use a different ORM.
Use query for multiple rows, queryObject for single row.
Install @types/mysql and augment or cast types as needed.
Run 'npm install hi-mysql' and ensure the import path matches the package name.
Use 'import hi from "hi-mysql"' instead of 'import { createPool } from "hi-mysql"'.Verify MySQL host, port, and credentials. Ensure the MySQL service is started and accessible.
Ensure createPool receives a valid configuration object or array. Check that object has required fields (host, user, password, database).