MySQL database components for the coajs framework, providing basic data models with built-in CRUD, cache data models backed by coa-redis, and distributed UUID generation. Version 1.7.1 is stable with intermittent releases. It wraps the mysql driver and knex query builder, keeping full knex API access via .io. All components are written in TypeScript and support ESM. Compared to standalone knex, it adds model abstractions for rapid CRUD and automatic cache management.
npm install coa-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates initializing MysqlBin with a config, performing a query via knex, and defining a simple model with MysqlNative to find a record by primary key.
Update imports to use ESM syntax: import { MysqlBin } from 'coa-mysql'.Install coa-redis: yarn add coa-redis or npm install coa-redis.
Use MysqlNative or MysqlCache model methods for CRUD.
Ensure 'databases' is provided with at least one entry, e.g., { main: { database: 'test', ms: 3600000 } }.Install coa-redis: npm install coa-redis or yarn add coa-redis.
Use ES module import: import { MysqlBin } from 'coa-mysql'.Verify MYSQL_PASSWORD environment variable or hardcode correct password in config (not recommended for production).