NAME

DBIO::PopulateMore - Enhanced populate with cross-source references

VERSION

version 0.900000

SYNOPSIS

package MyApp::Schema;
use base 'DBIO::Schema';

# Can be loaded as a component or used standalone
__PACKAGE__->load_components(qw/PopulateMore/);

# Or use directly on any schema instance:
# DBIO::PopulateMore->populate_more($schema, [...])

Then:

$schema->populate_more([
  { Gender => {
      fields => 'label',
      data => {
        male   => 'male',
        female => 'female',
      }}},
  { Person => {
      fields => ['name', 'age', 'gender'],
      data => {
        john => ['john', 38, '!Index:Gender.male'],
        jane => ['jane', 40, '!Index:Gender.female'],
      }}},
]);

DESCRIPTION

This module provides an enhanced version of the builtin "populate" in DBIO::Schema method. It allows inserting rows across multiple result sources in one call, with cross-referencing between them via the !Index:Source.key syntax.

Based on DBIx::Class::Schema::PopulateMore by John Napiorkowski.

Unlike other DBIO::Schema components, this module is not a schema plugin that inherits from DBIO::Schema. It is a standalone utility class that operates on any schema instance. It can be loaded as a component via "load_components" in DBIO::Schema, or used directly.

Inflators

Values starting with ! are processed by inflator plugins:

!Index:Source.key - Reference a previously inserted row
!Env:VAR_NAME - Substitute from %ENV
!Find:Source.[key=val] - Look up an existing row

METHODS

populate_more

Populate multiple sources with optional cross-source references and inflators.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.