ali-mysql-client (v1.0.7) is a lightweight Node.js MySQL client providing a fluent API for common database operations: select, insert, update, delete, with support for pagination, joins, grouping, ordering, and raw SQL. It wraps the `mysql` package, offering a more expressive chainable builder pattern akin to Knex but simpler. Released under MIT, it is suitable for small to medium projects that need quick MySQL access without ORM overhead.
npm install ali-mysql-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Complete CRUD example: insert, select with pagination, update, and delete using ali-mysql-client fluent API.
Always use lowercase operator strings: 'like', 'lt', 'gt', 'le', 'ge', 'ne'.
Consider using `mysql2` pool wrapper or implement pool yourself. Alternatively, use `knex` or `sequelize` for built-in pooling.
Use `db.literal('now()')` for MySQL functions. For arrays, use `db.literal('IN (1,2,3)')` or expand manually.Check documentation return values. Use `.toSql()` to get query string first for debugging.
Stick with `mysql` package as dependency. Do not replace with `mysql2` without testing compatibility.
Pass page number starting from 1. example: `.queryListWithPaging(1, 10)` for first page of 10 records.
Use `const db = new DbClient({...})` instead of `const db = DbClient({...})`.Run `npm install mysql` alongside ali-mysql-client.
Verify environment variables or hardcoded config: `host`, `user`, `password`, `database`. The library does not use `port` option by default; defaults to 3306.