Utility for creating and manipulating SQL tables using KnexJS schema building. Version 2.2.7 is stable. Automates database/table creation and provides a simplified interface with methods like get, getAll, getBy, create, update, upsert, filter, count, and streaming. Works with any database Knex supports: Postgres, MSSQL, MySQL, MariaDB, SQLite3, Oracle, Amazon Redshift. Differentiator: combines automatic schema initialization with a streaming interface, built on top of Knex but abstracts away connection pooling and table creation.
npm install mysql-tableNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a MySQL database with a users table, creates a row, and retrieves it.
Ensure the database user has CREATE DATABASE privileges, or pre-create the database.
Call table.alter(schema) after Init if schema changes are needed.
Use require('mysql-table') instead of import.Ensure unique constraints are handled via schema or use table.update/create with error handling.
Refer to Knex schema documentation for valid column methods and chaining.
Run 'npm install mysql-table' and ensure node_modules includes it.
Use 'const { Table } = require('mysql-table')'.Create the database manually or grant CREATE DATABASE privilege to the user.
Use table.upsert to update on conflict, or check existence with table.has before create.