{"id":44034,"library":"then-mysql","title":"then-mysql","description":"A promise-based wrapper for the MySQL driver that provides connection pooling and a nicer API. Version 1.1.1 (latest) is stable but unmaintained since 2015. It converts callback-style mysql queries to promises using a custom thenable pattern, making it incompatible with modern async/await and ES6 Promises. It is a legacy alternative to mysql2 with promise support or knex.","status":"deprecated","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/then/then-mysql","tags":["javascript","promise","then","database","mysql"],"install":[{"cmd":"npm install then-mysql","lang":"bash","label":"npm"},{"cmd":"yarn add then-mysql","lang":"bash","label":"yarn"},{"cmd":"pnpm add then-mysql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: then-mysql wraps the mysql npm package. Must be installed separately.","package":"mysql","optional":false}],"imports":[{"note":"This package is CommonJS only and does not support ESM imports.","wrong":"import MySql from 'then-mysql';","symbol":"MySql","correct":"var MySql = require('then-mysql');"}],"quickstart":{"code":"var MySql = require('then-mysql');\nvar pool = new MySql({\n  host: 'localhost',\n  user: 'me',\n  password: 'secret'\n});\n\npool.query('SELECT 1 + 1 AS solution')\n  .done(function (result) {\n    console.log(result[0].solution); // 2\n    pool.dispose().done();\n  });","lang":"javascript","description":"Creates a connection pool and runs a simple query using the promised-based API."},"warnings":[{"fix":"Switch to a modern library like mysql2 with promise support, or use knex.","message":"then-mysql uses a custom thenable pattern that is not compatible with native Promises or async/await.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Run `npm install mysql` alongside then-mysql.","message":"The package requires the mysql npm package as a peer dependency but does not list it in package.json. You must install mysql separately.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Always chain .done() or switch to native promises that execute automatically.","message":"The .done() method must be called on promises to trigger execution; forgetting it will cause queries to never execute.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.1.1':22 '2015':29 'altern':57 'api':20 'async/await':49 'base':7 'callback':33 'callback-styl':32 'connect':15 'convert':31 'custom':41 'databas':68 'driver':12 'es6':51 'incompat':46 'javascript':65 'knex':64 'latest':23 'legaci':56 'make':44 'modern':48 'mysql':3,11,35,69 'mysql2':59 'nicer':19 'pattern':43 'pool':16 'promis':6,38,52,61,66 'promise-bas':5 'provid':14 'queri':36 'sinc':28 'stabl':25 'style':34 'support':62 'then-mysql':1 'thenabl':42 'unmaintain':27 'use':39 'version':21 'wrapper':8","created_at":"2026-06-05T17:02:39.821056+00:00","updated_at":"2026-06-05T17:02:39.821056+00:00","problems":[{"fix":"Use .done() instead of .then() to execute the query.","cause":"Forgetting to call .done() or using native Promise methods like .then() instead of .done().","error":"TypeError: pool.query(...).done is not a function"},{"fix":"Run `npm install mysql`.","cause":"The mysql peer dependency is not installed.","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/then/then-mysql#readme","github":"https://github.com/then/then-mysql","docs":null,"changelog":null,"pypi":null,"npm":"then-mysql","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}}