{"id":43473,"library":"node-workhorse-mysql","title":"Node Workhorse MySQL","description":"Extensions for Node Workhorse to persist data in MySQL. Version 1.0.1 enables storing workhorse job queues and state in a MySQL database. Provides integration patterns for MySQL with the workhorse task queue system. TypeScript definitions included. Suitable for projects already using Node Workhorse and seeking durable storage backend.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/colinmathews/node-workhorse-mysql","tags":["javascript","typescript"],"install":[{"cmd":"npm install node-workhorse-mysql","lang":"bash","label":"npm"},{"cmd":"yarn add node-workhorse-mysql","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-workhorse-mysql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core package for task queue functionality","package":"node-workhorse","optional":false}],"imports":[{"note":"ESM-only since v1.0.0","wrong":"const MysqlBackend = require('node-workhorse-mysql')","symbol":"MysqlBackend","correct":"import { MysqlBackend } from 'node-workhorse-mysql'"},{"note":"Default export is available but named export is preferred.","wrong":"const MysqlBackend = require('node-workhorse-mysql').default","symbol":"MysqlBackend","correct":"import MysqlBackend from 'node-workhorse-mysql'"},{"note":"Also exported as SqlBackend, use if you want generic SQL backend.","wrong":null,"symbol":"SqlBackend","correct":"import { SqlBackend } from 'node-workhorse-mysql'"}],"quickstart":{"code":"import { Workhorse } from 'node-workhorse';\nimport { MysqlBackend } from 'node-workhorse-mysql';\n\nconst backend = new MysqlBackend({\n  host: process.env.MYSQL_HOST || 'localhost',\n  user: process.env.MYSQL_USER || 'root',\n  password: process.env.MYSQL_PASS || '',\n  database: process.env.MYSQL_DB || 'workhorse',\n});\n\nconst workhorse = new Workhorse({ backend });\n\n// Add a job\nworkhorse.add({ task: 'email', data: { to: 'user@example.com' } });","lang":"typescript","description":"Initializes a MysqlBackend and sets up a Workhorse instance for queuing jobs."},"warnings":[{"fix":"Provide an object with host, user, password, database keys.","message":"MysqlBackend constructor requires options, not a connection string.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure you close the backend when shutting down your application.","message":"MySQL connection pool is not automatically closed; call `backend.close()` to release resources.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use async/await or .then() instead of callbacks.","message":"Version 1.0.0 dropped support for callbacks; only promises are supported.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':14 'alreadi':43 'backend':51 'data':10 'databas':25 'definit':38 'durabl':49 'enabl':15 'extens':4 'includ':39 'integr':27 'javascript':52 'job':18 'mysql':3,12,24,30 'node':1,6,45 'pattern':28 'persist':9 'project':42 'provid':26 'queue':19,35 'seek':48 'state':21 'storag':50 'store':16 'suitabl':40 'system':36 'task':34 'typescript':37,53 'use':44 'version':13 'workhors':2,7,17,33,46","created_at":"2026-06-05T16:59:57.941344+00:00","updated_at":"2026-06-05T16:59:57.941344+00:00","problems":[{"fix":"Run `npm install node-workhorse-mysql` and ensure import path is correct.","cause":"Package not installed or typo in import","error":"Cannot find module 'node-workhorse-mysql'"},{"fix":"Use `import { MysqlBackend } from 'node-workhorse-mysql'`.","cause":"Importing incorrectly or using CommonJS with named import","error":"MysqlBackend is not a constructor"}],"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/colinmathews/node-workhorse-mysql#readme","github":"https://github.com/colinmathews/node-workhorse-mysql","docs":null,"changelog":null,"pypi":null,"npm":"node-workhorse-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}}