{"id":43332,"library":"mysql-qs-parse","title":"mysql-qs-parse","description":"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.","status":"active","version":"2.4.18","language":"javascript","source_language":"en","source_url":"https://github.com/a572251465/mysql-qs-parse","tags":["javascript","mysql","parser","select","delete","update","insert","typescript"],"install":[{"cmd":"npm install mysql-qs-parse","lang":"bash","label":"npm"},{"cmd":"yarn add mysql-qs-parse","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysql-qs-parse","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for MySQL database connectivity","package":"mysql","optional":false}],"imports":[{"note":"ESM default import; CJS require also works but ESM is recommended for new projects","wrong":"const MysqlParse = require('mysql-qs-parse')","symbol":"default","correct":"import MysqlParse from 'mysql-qs-parse'"},{"note":"Named import of default export not available; use default import only","wrong":"import { MysqlParse } from 'mysql-qs-parse'","symbol":"MysqlParse","correct":"import { default as MysqlParse } from 'mysql-qs-parse'"},{"note":"TypeScript users can import types via this path (if library ships types)","wrong":"","symbol":"QueryResult","correct":"import type { QueryResult } from 'mysql-qs-parse'"}],"quickstart":{"code":"import MysqlParse from 'mysql-qs-parse';\nimport { once } from 'events';\n\nconst db = new MysqlParse({\n  host: process.env.DB_HOST ?? 'localhost',\n  user: process.env.DB_USER ?? 'root',\n  password: process.env.DB_PASSWORD ?? '',\n  database: process.env.DB_NAME ?? 'test'\n});\n\ndb.on('error', (err) => console.error(err));\ndb.on('mysql-log', (sql) => console.log('SQL:', sql));\n\nasync function run() {\n  await db.open();\n  const res = await db.find(['name', 'id'], 'users', { age: 20 });\n  console.log(res);\n  db.release();\n}\nrun();","lang":"typescript","description":"Shows how to instantiate MysqlParse with config object, connect, run a query, and release connection."},"warnings":[{"fix":"Always call db.release() after your database operations are complete.","message":"Must call release() after each query or group of queries to free connections. Failing to do so will cause connection leaks.","severity":"gotcha","affected_versions":"*"},{"fix":"For each request/operation, call await db.open() then use db, then db.release().","message":"Before each set of queries, you must call db.open() again after release(). The library does not auto-reconnect.","severity":"gotcha","affected_versions":"*"},{"fix":"Use object config: new MysqlParse({host: '...', user: '...', password: '...', database: '...'})","message":"In 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.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use db.query() or future API; refer to docs for updated patterns.","message":"The find method with extra object (fields, tableName, where, order, limit) is deprecated in favor of separate methods.","severity":"deprecated","affected_versions":">=2.4.0"}],"env_vars":null,"search_vec":"'2.4.18':30 'architectur':25 'base':24 'builder':8 'built':64 'built-in':63 'call':82 'close':53 'connect':44,76 'crud':18 'current':26 'delet':40,73,87 'differenti':62 'error':54 'event':51 'eventemitt':48 'filter':67 'find':36 'findon':37 'insert':38,89 'instanc':45 'javascript':83 'key':61 'librari':13,32 'lifecycl':50 'like':12,35 'log':57,68 'logical/physical':72 'manag':77 'manual':75 'method':34 'mysql':2,6,43,56,84 'mysql-log':55 'mysql-qs-pars':1 'node.js':15 'open':52,79 'oper':19 'orm':11 'orm-lik':10 'pars':4 'parser':85 'plugin':23 'plugin-bas':22 'promis':60 'provid':33 'qs':3 'queri':7 'releas':81 'requir':74 'secur':66 'select':86 'stabl':27 'support':17,59,70 'typescript':90 'updat':39,88 'use':47 'version':28","created_at":"2026-06-05T16:59:17.963725+00:00","updated_at":"2026-06-05T16:59:17.963725+00:00","problems":[{"fix":"Ensure you are using version >=2.0.0 and import correctly: const db = new MysqlParse(...); db.find(...)","cause":"The imported object is not the MysqlParse instance or the version is too old.","error":"TypeError: db.find is not a function"},{"fix":"Always call db.release() after queries and re-open with db.open() before next use. Check MySQL wait_timeout.","cause":"The MySQL server timed out or the connection was not released properly.","error":"Error: Connection lost: The server closed the connection."},{"fix":"Install the peer dependency: npm install mysql","cause":"The mysql package is missing from node_modules.","error":"Error: Cannot find module 'mysql'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/a572251465/mysql-qs-parse","github":"https://github.com/a572251465/mysql-qs-parse","docs":null,"changelog":null,"pypi":null,"npm":"mysql-qs-parse","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}