Registry / database / antares-mysql-dumper

antares-mysql-dumper

JSON →
library0.0.1jsnpmunverified

A MySQL database dumper for Node.js that exports schema and data into SQL files. Version 0.0.1, released as a utility by the Antares SQL project. Supports both mysql and mysql2 clients. Key differentiators: per-table control over structure/content, optional compression, configurable INSERT chunking, and support for views, triggers, routines, functions, and schedulers. Stable but early-stage, with integration tests using Docker.

npm install antares-mysql-dumper
INSTALL
IMPORT
SIG · ANTARES-MYSQL-DUMP
A
antares-mysql-dumper
databasejavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MySqlDumper
import MySqlDumper from 'antares-mysql-dumper'
const MySqlDumper = require('antares-mysql-dumper')
ESM-only, no CommonJS support.
MySqlDumperOptions_Table
import { MySqlDumperOptions_Table } from 'antares-mysql-dumper'
TypeScript type export for per-table options.
MySqlDumperOptions_Includes
import { MySqlDumperOptions_Includes } from 'antares-mysql-dumper'
TypeScript type export for includes options.

Connects to a MySQL database and dumps its entire schema and data to a file.

import MySqlDumper from 'antares-mysql-dumper'; import mysql2 from 'mysql2'; const connection = mysql2.createConnection({ host: 'localhost', port: 3306, user: process.env.MYSQL_USER ?? 'root', password: process.env.MYSQL_PASSWORD ?? '', database: 'myDatabase', }); const dumper = new MySqlDumper({ connection, schema: 'myDatabase', outputFile: 'dump.sql', }); await dumper.run(); console.log('Dump completed.');
Debug
Known issues
gotchaThe package uses any type for the connection option, allowing both mysql and mysql2 clients, but incorrect connection objects (e.g., from mysql2/promise) may cause runtime errors.
fix
Ensure the connection object is from mysql2 (not mysql2/promise) or adjust type assertions.
affects: >=0.0.1
gotchaThe outputFile path is relative to the current working directory, not the script directory. Using a relative path may lead to files being written in unexpected locations.
fix
Use an absolute path or ensure the working directory is as expected.
affects: >=0.0.1
gotchaThe compress option is not yet documented and may not be stable. Using it could result in unexpected behavior or crashes.
fix
Avoid using compress until it is officially documented and tested.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: connection.query is not a function
Using a promise-based connection (e.g., from mysql2/promise) which returns a different query method.
fix
Use mysql2.createConnection() directly, not mysql2.createConnectionPool() or the promise-based API.
Error: Cannot find module 'antares-mysql-dumper'
The package is not installed or is not in node_modules.
fix
Run npm install antares-mysql-dumper or yarn add antares-mysql-dumper.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
mysql2requiredDatabase driver for MySQL connections
Agent activity
29 hits · last 30 days
node
22
OpenAI (training)
1
Resources
antares-mysql-dumper — npm install antares-mysql-dumper · libregistry