A modified MySQL JavaScript package adapted for Cloudflare Workers by removing Node.js-specific dependencies. Version 0.9.4 is the latest stable release, with no regular release cadence. Key differentiators: provides a familiar MySQL connection API for Workers, includes TypeScript types, but connections must be created per request (cannot persist). Strongly recommended against for new projects — consider serverless databases like Cloudflare D1 or Turso instead.
npm install cloudflare-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connect to MySQL from a Cloudflare Worker, run a query, return JSON response. Uses per-request connection.
Use a serverless database (D1, Turso) for persistent connections. If using MySQL, expect high connection overhead.
Test all MySQL features you rely on; some may not work in Workers environment.
Consider Cloudflare D1 or Turso as alternatives.
Check the underlying mysqljs/mysql repository for supported features.
Use cloudflare-mysql which replaces 'net' with a Worker-compatible polyfill.
Create a new connection per request.
Ensure you import { createConnection } and call connection.query after connection.connect callback.No dependency data recorded yet.