A lightweight MySQL utility for Node.js that simplifies CRUD operations with a declarative, non-SQL-like syntax. Version 1.1.1 provides an abstraction over raw MySQL queries for select, insert, update, and delete operations. It uses a connection pool for efficient database management. Known for its simplicity, it is suitable for small to medium projects but lacks advanced features like migrations, query building, or TypeScript support. Alternative to knex or mysql2/promise.
npm install mysql-query-utilNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a MySQL connection pool and performs a select query on the 'users' table using async/await.
Use async/await or promise chaining.
Call mysqlUtil.setConnection with valid config at startup.
Ensure each condition array is exactly 3 or 4 elements: [field, operator, value] or ['AND'/'OR', field, operator, value].
Upgrade to >=1.0.0 and use setConnection with pool options.
Use require('mysql-query-util') and install package via npm.Invoke mysqlUtil.setConnection({...}) at startup.Ensure mysqlUtil calls are awaited in async route handlers.