{"id":43623,"library":"pimp-my-sql","title":"pimp-my-sql","description":"A promise-based SQL library for Node.js, primarily aimed at MySQL use cases. Current stable version 0.6.3 wraps the mysql npm package with Bluebird promises, providing a cleaner API for query building and execution. The library supports parameterized queries, nested result sets, and transaction helpers. Release cadence is irregular; last update was several years ago. Compared to alternatives like mysql2 or knex, this package is minimal and no longer actively maintained. It offers basic query building with promise chaining but lacks TypeScript definitions and modern ESM support.","status":"deprecated","version":"0.6.3","language":"javascript","source_language":"en","source_url":"https://github.com/influentialpublishers/pimp-my-sql","tags":["javascript","promise","bluebird","mysql","sql"],"install":[{"cmd":"npm install pimp-my-sql","lang":"bash","label":"npm"},{"cmd":"yarn add pimp-my-sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add pimp-my-sql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides promise implementation for the library's API.","package":"bluebird","optional":false},{"reason":"Underlying MySQL driver used for database connections.","package":"mysql","optional":false}],"imports":[{"note":"The package is ESM-only, CommonJS require will fail. Types are not included.","wrong":"const pimpMySql = require('pimp-my-sql')","symbol":"default","correct":"import pimpMySql from 'pimp-my-sql'"},{"note":"Default export is a class constructor. Named import does not exist.","wrong":"const { PimpMySql } = require('pimp-my-sql')","symbol":"PimpMySql","correct":"import PimpMySql from 'pimp-my-sql'"},{"note":"QueryBuilder is accessible as a static property on the default export, not a named export.","wrong":"import { QueryBuilder } from 'pimp-my-sql'","symbol":"QueryBuilder","correct":"import pimpMySql from 'pimp-my-sql'; const qb = new pimpMySql.QueryBuilder()"}],"quickstart":{"code":"import pimpMySql from 'pimp-my-sql';\n\nconst db = new pimpMySql({\n  host: 'localhost',\n  user: 'root',\n  password: process.env.DB_PASSWORD ?? '',\n  database: 'test'\n});\n\nasync function run() {\n  try {\n    const result = await db.query('SELECT 1 + 1 AS solution');\n    console.log('Result:', result);\n  } catch (err) {\n    console.error('Query failed:', err);\n  }\n  await db.end();\n}\n\nrun();","lang":"javascript","description":"Initializes a MySQL connection using pimp-my-sql, runs a simple SELECT query with async/await, logs the result, and closes the connection."},"warnings":[{"fix":"Migrate to mysql2 or knex for modern promise support and active maintenance.","message":"pimp-my-sql is unmaintained; last release in 2016. No future updates.","severity":"deprecated","affected_versions":"*"},{"fix":"Wrap Bluebird promises with Promise.resolve() if you need native promise methods.","message":"Package uses Bluebird promises; not compatible with native Promise chaining in some edge cases (e.g., .finally()).","severity":"breaking","affected_versions":"*"},{"fix":"Install mysql as a dependency; do not use mysql2 as it will cause runtime errors.","message":"Package only works with the 'mysql' npm package; not compatible with mysql2.","severity":"gotcha","affected_versions":"*"},{"fix":"Use @types/mysql if needed, but expect limited support.","message":"No TypeScript definitions; all types will be 'any'.","severity":"deprecated","affected_versions":"*"},{"fix":"Use dynamic import() in CommonJS files or switch to ESM.","message":"ESM-only: Cannot be imported with CommonJS require(). Error: 'require() of ES Module not supported'.","severity":"breaking","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.6.3':22 'activ':75 'ago':60 'aim':14 'altern':63 'api':34 'base':8 'basic':79 'bluebird':29,95 'build':37,81 'cadenc':52 'case':18 'chain':84 'cleaner':33 'compar':61 'current':19 'definit':88 'esm':91 'execut':39 'helper':50 'irregular':54 'javascript':93 'knex':67 'lack':86 'last':55 'librari':10,41 'like':64 'longer':74 'maintain':76 'minim':71 'modern':90 'mysql':16,25,96 'mysql2':65 'nest':45 'node.js':12 'npm':26 'offer':78 'packag':27,69 'parameter':43 'pimp':2 'pimp-my-sql':1 'primarili':13 'promis':7,30,83,94 'promise-bas':6 'provid':31 'queri':36,44,80 'releas':51 'result':46 'set':47 'sever':58 'sql':4,9,97 'stabl':20 'support':42,92 'transact':49 'typescript':87 'updat':56 'use':17 'version':21 'wrap':23 'year':59","created_at":"2026-06-05T17:00:41.320460+00:00","updated_at":"2026-06-05T17:00:41.320460+00:00","problems":[{"fix":"Run 'npm install pimp-my-sql' and ensure it is in dependencies.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'pimp-my-sql'"},{"fix":"Use ESM import syntax: 'import pimpMySql from 'pimp-my-sql''","cause":"Using CommonJS require() instead of import, or wrong default import syntax.","error":"TypeError: pimpMySql is not a constructor"},{"fix":"Alter MySQL user to use mysql_native_password: 'ALTER USER 'user'@'host' IDENTIFIED WITH mysql_native_password BY 'password';'","cause":"MySQL 8+ default authentication plugin is caching_sha2_password, which the mysql package may not support.","error":"Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol"},{"fix":"Implement connection retry logic or use connection pooling with the underlying mysql package.","cause":"Idle connection timeout or server restart.","error":"Error: Connection lost: The server closed the connection."}],"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/influentialpublishers/pimp-my-sql#readme","github":"https://github.com/influentialpublishers/pimp-my-sql","docs":null,"changelog":null,"pypi":null,"npm":"pimp-my-sql","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}}