MySQL client for Node.js extending the popular mysql module with automatic table schema definition and migration. Current stable version is 0.16.2, released regularly on npm. Key differentiators: chainable column type definitions (e.g., db.ColTypes.bigint().unsigned().notNull()), auto-migration of table schemas, and promise support for queries and transactions. Comparable to knex or sequelize but lighter and more opinionated, focusing on schema definition and migration simplicity. Requires Node >=6 and depends on the mysql package.
npm install mysql-plusNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a pool, defines a user table with auto-migrating columns, syncs schema, and inserts a row.
Call db.sync() before using the table, typically in app startup.
Use await pool.query(...) or pool.query(...).then() instead of pool.query(..., callback).
Update column definitions to use chainable syntax: { columns: { id: db.ColTypes.bigint().unsigned().notNull() } }npm install mysql
Use migration strategies like ALTER or DROP, or manually adjust schema.
Use standard mysql connection options (host, user, password, database).
Ensure the pool is created correctly: const db = mysql.createPool({...}); db.sync();Call db.sync() first and check for errors: db.sync(err => { if(err) throw err; ... });Verify columns use correct ColTypes methods (e.g., db.ColTypes.varchar(255)) and include notNull when needed.
Use const mysql = require('mysql-plus'); and ensure version >=0.12.0 for promise support.Check for duplicate column names in the columns object; remove duplicates.