MySQL adapter for schema-seed (v0.1.11), a test-data seeding library for relational databases. This package is automatically loaded by schema-seed CLI when a MySQL connection string is detected. Current version is early (pre-1.0), with no active release cadence. Key differentiator: integrates seamlessly with schema-seed's schema-driven seeding approach for MySQL, allowing developers to define seed data in JSON/YAML and apply it directly to a MySQL database. Note: only compatible with mysql2 driver, not mysql proper. This adapter handles table creation, foreign key ordering, and data insertion.
npm install schema-seed-adapter-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures schema-seed with MySQL adapter and runs seeding from local seeds directory.
Ensure your project has mysql2 installed and use mysql2 connection strings.
Set seedOptions.dropTable: false in config to preserve data, but be aware of potential conflicts.
Avoid circular references in seed schema or manually order seed files.
Use schema-seed with a connection pool configuration if needed (future version).
npm install mysql2
Check DB_HOST, DB_USER, DB_PASSWORD environment variables or config object.
Use default import: import adapter from 'schema-seed-adapter-mysql'
Create the database first: CREATE DATABASE `your-db-name`;