mysqljs/mysql ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Node.js MySQL client library that lets me connect to a MySQL database, run queries, and manage connections in a simple way.
I want to be able to create a connection with host, user, password, and database, then call connect, query, and end. It should support the usual things people need, like escaping values safely, getting results back as JavaScript objects, handling inserts and affected row counts, and working with transactions. Please also include connection pooling so repeated queries are easier and the app can reuse connections.
If it makes sense, add support for streaming query results, multiple statements, stored procedures, and basic error handling so connection problems and query failures are easy to deal with. Keep it clean and easy to use from plain JavaScript, without needing any build step. If you need to check any current MySQL or Node docs while implementing, feel free to look them up online.
Are you gonna build this?
make sure you review the code using coderabbit