Changes for version 0.03 - 2026-03-12
- New features:
- generate() now accepts an 'only' argument (arrayref of source names) to restrict data generation to a specific subset of tables.
- generate() now accepts an 'exclude' argument (arrayref of source names) to skip selected tables while populating the rest.
- Both filters preserve FK-safe insertion order within the active set.
- Both filters are respected by dry_run() as well as generate().
- Passing both 'only' and 'exclude' to new() croaks immediately with a clear error message.
- Passing an unknown source name in either argument croaks with a descriptive error identifying the offending name(s).
- CLI tool:
- Added --only <Table,...> (comma-separated) to the dbic-mockdata script.
- Added --exclude <Table,...> (comma-separated) to the dbic-mockdata script.
- CLI validates mutual exclusion of --only and --exclude before invoking the module.
- Test suite:
- t/04-filter.t -- 16 unit subtests covering only/exclude behaviour, FK ordering within filtered sets, dry_run filtering, invalid input validation, and mutual-exclusion enforcement.
- t/03-cli.t -- extended with 7 new subtests for --only and --exclude including single table, comma-separated lists, unknown source names, and the --only + --exclude conflict check.
- Bug fixes:
- _active_sources() previously called $schema->source() to validate names, which caused DBIx::Class to throw its own exception before our error message could be raised. Validation now uses a pre-built lookup hash from the known source list, giving callers a clean, actionable error.
Modules
Generate mock test data for DBIx::Class schemas