{"library":"phanx-mysql","title":"phanx-mysql","description":"A MySQL database wrapper for Node.js providing async/await promises, TypeScript definitions, and helper methods for insert/update and named parameters. Current stable version is 0.3.16, last updated with Node.js 11.x support. It wraps the mysql npm package and adds a promise-based interface, automatic idle connection closing, and a query formatter that supports both positional (?) and named (:name) parameters. Unlike more modern libraries (e.g., mysql2, knex), it requires manual configuration via a config.json file and is not actively maintained. It is suitable for simple use cases but lacks connection pooling with advanced features, and the API is somewhat unconventional (e.g., accessing results via getters like db.rows).","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install phanx-mysql"],"cli":null},"imports":["import PhanxMysql from 'phanx-mysql'","import PhanxMysql from 'phanx-mysql'","import type { PhanxMysqlConfig } from 'phanx-mysql'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import PhanxMysql from 'phanx-mysql';\nimport config from './config.json' with { type: 'json' };\n\nPhanxMysql.config = config;\nPhanxMysql.setAutoCloseMinutes(1);\n\nasync function run() {\n  const db = await PhanxMysql.createAndStart();\n  const rows = await db.query('select * from test;');\n  if (db.error) console.error(db.error);\n  console.log(rows);\n  await db.end();\n}\nrun().catch(console.error);","lang":"typescript","description":"Shows how to import, configure, create a connection, run a query, and close the connection using async/await.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}