Revision history for DBIx::Class::MockData

0.04  2026-03-17

      [NEW FEATURES]
      - Added rows_per_table parameter to specify different row counts per table
      - Added generators parameter for custom column value generation
        Supports static values, row interpolation ({row}), and Perl code references

      [ENHANCEMENTS]
      - Bulk insert using populate() for up to 10x faster performance
      - Salt value now randomized even when seed is set (ensures cross-run uniqueness)
      - Better handling of unique constraints across all column types
      - Improved error handling with graceful failure recovery

      [DOCUMENTATION]
      - Added comprehensive examples for rows_per_table and generators
      - Documented performance improvements and best practices

      [INTERNAL]
      - Refactored _generate_value to support custom generators
      - Added rows_per_table support in generate() loop
      - Updated CLI tool with --rows-per-table and --generators options
      - Comprehensive test coverage for all new features

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.

0.02  2026-03-11

      - Makefile.PL: added provides block to META_MERGE so MetaCPAN correctly
        indexes DBIx::Class::MockData with its version.
      - README.md: corrected SYNOPSIS to use new() with a pre-connected schema
        instead of the removed schema() entry point.
      - Bumped version to 0.02 in MockData.pm and script/dbic-mockdata.


0.01  2026-03-11

      First release.

      New features:
      - new() constructor accepts a connected DBIx::Class::Schema object and
        schema_dir; connection is entirely the caller's responsibility.
      - deploy()   -- creates missing tables via DBIx::Class schema deployment.
      - wipe()     -- drops all tables and redeploys from scratch (test use only).
      - generate() -- introspects all result sources, resolves FK insertion order
                      via topological sort, and inserts randomly generated rows.
      - dry_run()  -- prints generated values without touching the database.
      - All public methods return $self for call chaining.

      Data generation:
      - Values derived entirely from each column's declared data_type.
      - Contextual strings for varchar/text columns matched on column name
        (email, slug, title, status, url, etc.).
      - Unique and PK columns salted with a per-run random value to prevent
        cross-run constraint violations.
      - Optional seed argument for fully reproducible output.

      CLI tool:
      - script/dbic-mockdata with --schema-dir, --namespace, --dsn, --deploy,
        --wipe, --dry-run, --rows, --seed, --verbose, --help.

      Test suite:
      - t/01-basic.t  -- unit tests with inline schema.
      - t/02-schema.t -- integration tests against t/lib/TestSchema
                         (Author -> Book -> Review FK chain).
      - t/03-cli.t    -- subprocess tests for the CLI script via IPC::Open3.
