{"id":43337,"library":"mysql-query-promise","title":"mysql-query-promise","description":"Lightweight promise-based wrapper around mysql-query-js for Node.js MySQL connections. Version 1.0.1, stable but unmaintained since 2015. Provides a single query() function that returns promises, with support for multiple named database configurations via the 'config' module. Differentiators: minimal API, integrated config management, and pool support. Alternatives: mysql2/promise, knex, or sequelize offer more features.","status":"deprecated","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/ria-com/node-mysql-query-promise","tags":["javascript","mysql","promise","node","config","pool"],"install":[{"cmd":"npm install mysql-query-promise","lang":"bash","label":"npm"},{"cmd":"yarn add mysql-query-promise","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysql-query-promise","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core query execution engine","package":"mysql-query-js","optional":false},{"reason":"Configuration management for database settings","package":"config","optional":true}],"imports":[{"note":"Package uses CommonJS and does not provide ESM exports. Use require() only.","wrong":"import query from 'mysql-query-promise';","symbol":"query","correct":"const query = require('mysql-query-promise');"},{"note":"The default export is a single function, not an object with named exports.","wrong":"const { query } = require('mysql-query-promise');","symbol":"query as default import","correct":"const query = require('mysql-query-promise');"},{"note":"No TypeScript definitions available. Use require and disable type checking.","wrong":"import query from 'mysql-query-promise';","symbol":"TypeScript usage","correct":"// @ts-ignore\nconst query = require('mysql-query-promise');"}],"quickstart":{"code":"const query = require('mysql-query-promise');\nconst qs = 'SELECT * FROM users WHERE id = ?';\nquery(qs, [1], 'master')\n  .then(rows => console.log(rows))\n  .catch(err => console.error(err));","lang":"javascript","description":"Promisified MySQL query execution with config-based connection pool."},"warnings":[{"fix":"Migrate to mysql2: npm install mysql2 and use require('mysql2/promise').createPool().query().","message":"Package is abandoned; last update in 2015. Use mysql2/promise or other maintained libraries.","severity":"deprecated","affected_versions":">=0"},{"fix":"Use const query = require('mysql-query-promise') without curly braces.","message":"The require() returns a single function, not an object. Using destructuring will break.","severity":"gotcha","affected_versions":">=0"},{"fix":"Install config: npm install config and create config/default.js with database section.","message":"Requires 'config' module to be installed and configured; else throws 'ENOENT: config not found'.","severity":"gotcha","affected_versions":">=0"},{"fix":"Wrap in try-catch or add .catch() with detailed logging.","message":"No explicit errors if connection fails; promise rejects but error messages are unclear.","severity":"breaking","affected_versions":">=0"}],"env_vars":null,"search_vec":"'1.0.1':20 '2015':25 'altern':54 'api':47 'around':10 'base':8 'config':43,49,66 'configur':40 'connect':18 'databas':39 'differenti':45 'featur':61 'function':30 'integr':48 'javascript':62 'js':14 'knex':56 'lightweight':5 'manag':50 'minim':46 'modul':44 'multipl':37 'mysql':2,12,17,63 'mysql-query-j':11 'mysql-query-promis':1 'mysql2/promise':55 'name':38 'node':65 'node.js':16 'offer':59 'pool':52,67 'promis':4,7,33,64 'promise-bas':6 'provid':26 'queri':3,13,29 'return':32 'sequel':58 'sinc':24 'singl':28 'stabl':21 'support':35,53 'unmaintain':23 'version':19 'via':41 'wrapper':9","created_at":"2026-06-05T16:59:19.145845+00:00","updated_at":"2026-06-05T16:59:19.145845+00:00","problems":[{"fix":"Run: npm install config","cause":"The package depends on the 'config' module for database configuration, but it's not installed.","error":"Cannot find module 'config'"},{"fix":"Use: const query = require('mysql-query-promise')","cause":"Using destructured import like const { query } = require('mysql-query-promise') instead of direct assignment.","error":"TypeError: require(...) is not a function"},{"fix":"Ensure config/default.js exports a 'database' object with connection settings.","cause":"The 'config' module is installed but the configuration file (default.js) is missing the 'database' key.","error":"Cannot read property 'database' of undefined"}],"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/ria-com/node-mysql-query-promise","github":"https://github.com/ria-com/node-mysql-query-promise","docs":null,"changelog":null,"pypi":null,"npm":"mysql-query-promise","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}}