Populate database tables with test data using the Akron CLI across SQLite, MySQL, PostgreSQL, and MongoDB.
The seed
command populates your database tables with test or initial data. Perfect for development, testing, and setting up demo environments with realistic data.
akron seed <table_name> --db <database_url> --data <data_json>
Type: str (required)
Name of the table to populate with data.
Type: str (required)
Database connection URL.
Type: JSON array (required)
Array of objects to insert into the table.
Type: str (optional)
Path to JSON file containing seed data (alternative to --data).
✓ Seeded 2 records into 'users' table ✓ Data inserted successfully
✓ Loaded seed data from products_seed.json ✓ Seeded 3 records into 'products' table
✓ Seeded 2 records into 'orders' table ✓ Complex data types handled automatically
✓ Seeded 1 document into 'user_profiles' collection ✓ Nested objects and arrays preserved
Large datasets are automatically processed in batches for optimal performance:
Seed data is validated against table schema before insertion, preventing type errors.
Use unique constraints or primary keys to handle duplicate data appropriately.