A Node.js module for simplifying MySQL database interactions with a query builder interface. Version 1.2.0 offers promise-based methods like aselect for building SELECT queries with join support, and a raw query method. It wraps the mysql2 package and provides a simple API for managing connections and executing queries. Ships TypeScript definitions. Key differentiators include a fluent join syntax and support for environment variable configuration.
npm install advanced-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a connection, performs a SELECT query with a JOIN using the ASQL query builder, and logs the result.
Use 'selects' instead of 'select'.
Set environment variables as per documentation: DB_NAME, FSQL_HOST, FSQL_USER, FSQL_PASSWORD.
Call await db.createConnection() after instantiation.
Use correct spelling 'password' in constructor arguments.
Use db.closeConnection() to properly close the connection.
const db = new ASQL(...); await db.createConnection();
npm install advanced-mysql
Use await before async calls, e.g., const data = await db.aselect(...);