Registry / database / mysql-qs-parse

mysql-qs-parse

JSON →
library2.4.18jsnpmunverified

A MySQL query builder and ORM-like library for Node.js that supports CRUD operations with a plugin-based architecture. Current stable version is 2.4.18. The library provides methods like find, findOne, insert, update, delete on a MySQL connection instance. It uses EventEmitter for lifecycle events (open, close, error, mysql-log) and supports Promises. Key differentiators: built-in security filtering, logging, and support for logical/physical deletion. Requires manual connection management with open() and release() calls.

npm install mysql-qs-parse
INSTALL
IMPORT
SIG · MYSQL-QS-PARSE
M
mysql-qs-parse
databasejavascriptv2.4.18
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import MysqlParse from 'mysql-qs-parse'
const MysqlParse = require('mysql-qs-parse')
ESM default import; CJS require also works but ESM is recommended for new projects
MysqlParse
import { default as MysqlParse } from 'mysql-qs-parse'
import { MysqlParse } from 'mysql-qs-parse'
Named import of default export not available; use default import only
QueryResult
import type { QueryResult } from 'mysql-qs-parse'
TypeScript users can import types via this path (if library ships types)

Shows how to instantiate MysqlParse with config object, connect, run a query, and release connection.

import MysqlParse from 'mysql-qs-parse'; import { once } from 'events'; const db = new MysqlParse({ host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'root', password: process.env.DB_PASSWORD ?? '', database: process.env.DB_NAME ?? 'test' }); db.on('error', (err) => console.error(err)); db.on('mysql-log', (sql) => console.log('SQL:', sql)); async function run() { await db.open(); const res = await db.find(['name', 'id'], 'users', { age: 20 }); console.log(res); db.release(); } run();
Debug
Known issues
gotchaMust call release() after each query or group of queries to free connections. Failing to do so will cause connection leaks.
fix
Always call db.release() after your database operations are complete.
affects: *
gotchaBefore each set of queries, you must call db.open() again after release(). The library does not auto-reconnect.
fix
For each request/operation, call await db.open() then use db, then db.release().
affects: *
breakingIn version 2.x, the constructor accepts either a connection string (host, user, password, database) or an object. Version 1.x only accepted a connection string.
fix
Use object config: new MysqlParse({host: '...', user: '...', password: '...', database: '...'})
affects: >=2.0.0
deprecatedThe find method with extra object (fields, tableName, where, order, limit) is deprecated in favor of separate methods.
fix
Use db.query() or future API; refer to docs for updated patterns.
affects: >=2.4.0
Errors
Common errors & fixes
TypeError: db.find is not a function
The imported object is not the MysqlParse instance or the version is too old.
fix
Ensure you are using version >=2.0.0 and import correctly: const db = new MysqlParse(...); db.find(...)
Error: Connection lost: The server closed the connection.
The MySQL server timed out or the connection was not released properly.
fix
Always call db.release() after queries and re-open with db.open() before next use. Check MySQL wait_timeout.
Error: Cannot find module 'mysql'
The mysql package is missing from node_modules.
fix
Install the peer dependency: npm install mysql
Upgrade
Version history
2.4.18latest on npm
Audit
Dependencies
mysqlrequiredRuntime dependency for MySQL database connectivity
Agent activity
2 hits · last 30 days
node
2
Resources
mysql-qs-parse — npm install mysql-qs-parse · libregistry