{"id":42568,"library":"ctl-mysql","title":"CTL MySQL wrapper","description":"Lightweight MySQL wrapper for Node.js that integrates with the CTL async flow control library (ctl >=1.0.0). Version 1.1.6 is current. Provides promise-based query execution and connection pooling. Differentiators: tight integration with CTL for structured error handling and composable async operations. Released by leanderlee.","status":"active","version":"1.1.6","language":"javascript","source_language":"en","source_url":"git@github.com:leanderlee/ctl-mysql","tags":["javascript"],"install":[{"cmd":"npm install ctl-mysql","lang":"bash","label":"npm"},{"cmd":"yarn add ctl-mysql","lang":"bash","label":"yarn"},{"cmd":"pnpm add ctl-mysql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for flow control integration","package":"ctl","optional":false}],"imports":[{"note":"Package supports ESM import; CommonJS require may work but is not guaranteed.","wrong":"const ctlMysql = require('ctl-mysql')","symbol":"default","correct":"import ctlMysql from 'ctl-mysql'"},{"note":"Named export 'connect' is a factory function; case-sensitive.","wrong":"import { Connect } from 'ctl-mysql'","symbol":"connect","correct":"import { connect } from 'ctl-mysql'"},{"note":"After connecting, use the returned object to execute queries.","symbol":"query","correct":"import { query } from 'ctl-mysql'"}],"quickstart":{"code":"import { connect } from 'ctl-mysql';\nimport ctl from 'ctl';\n\nconst db = connect({\n  host: 'localhost',\n  user: 'root',\n  password: process.env.DB_PASSWORD ?? '',\n  database: 'test'\n});\n\nasync function run() {\n  const rows = await db.query('SELECT 1 + 1 AS solution');\n  console.log(rows);\n}\n\nctl(run, { error: (err) => console.error(err) });","lang":"typescript","description":"Connects to a MySQL database using CTL MySQL wrapper, executes a simple query, and logs results."},"warnings":[{"fix":"Update to version 1.1.6 or later, which uses mysql >=2.18.1.","message":"Pollution vulnerability in mysql package used as dependency (CVE-2019-11358) - affects versions before 2.18.1.","severity":"gotcha","affected_versions":"<1.1.6"},{"fix":"Ensure ctl version matches '>=1.0.0'.","message":"CTL peer dependency version constraint (>1.0.0) may cause compatibility issues with earlier or later versions.","severity":"gotcha","affected_versions":">=1.1.6"}],"env_vars":null,"search_vec":"'1.0.0':19 '1.1.6':21 'async':14,44 'base':27 'compos':43 'connect':31 'control':16 'ctl':1,13,18,37 'current':23 'differenti':33 'error':40 'execut':29 'flow':15 'handl':41 'integr':10,35 'javascript':49 'leanderle':48 'librari':17 'lightweight':4 'mysql':2,5 'node.js':8 'oper':45 'pool':32 'promis':26 'promise-bas':25 'provid':24 'queri':28 'releas':46 'structur':39 'tight':34 'version':20 'wrapper':3,6","created_at":"2026-06-05T16:55:37.448998+00:00","updated_at":"2026-06-05T16:55:37.448998+00:00","problems":[{"fix":"Run 'npm install ctl-mysql ctl' to install both the wrapper and its peer dependency.","cause":"Missing peer dependency or incorrect installation.","error":"Error: Cannot find module 'ctl-mysql'"},{"fix":"Use ESM import: import { connect } from 'ctl-mysql'; const db = connect({...}); await db.query(...);","cause":"Using require or wrong import style, or not calling connect() first.","error":"TypeError: db.query is not a function"},{"fix":"Check host, user, password, and database name in connect options.","cause":"Incorrect database credentials or missing password.","error":"Access denied for user 'root'@'localhost'"}],"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":"git@github.com:leanderlee/ctl-mysql","github":"git@github.com:leanderlee/ctl-mysql","docs":null,"changelog":null,"pypi":null,"npm":"ctl-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}}