DBIx::C...t::Dump(3)
πΈ NAME πΈ
DBIx::Class::Migration::RunScript::Trait::Dump(3) β Dump fixtures. That's the whole vibe, bestie: it's the trait that lets you dump fixtures, and it's lowkey iconic. π
β¨ SYNOPSIS β¨
Here's the run-script moment, fr fr:
use DBIx::Class::Migration::RunScript;
builder {
'SchemaLoader',
'Dump',
sub {
shift->dump('countries');
};
};
π DESCRIPTION π
Okay so this is a Moo::Role that adds a dump method to your run script. It lets you dump fixtures from your runscripts, based on previously defined fixture configurations. Slay. β¨
This might be useful to you if you're building fixtures when they don't already exist yet (see DBIx::Class::Migration::RunScript::Trait::Populate) and then want to dump them as part of building up your database. For example:
use DBIx::Class::Migration::RunScript;
migrate {
my $self = shift;
if($self->set_has_fixtures('all_tables')) {
$self->populate('all_tables');
} else {
$self->schema
->resultset('Country')
->populate([
['code'],
['bel'],
['deu'],
['fra'],
]);
$self->dump('all_tables');
}
};
In the above example, if the fixture set exists and has previously been dumped, we will populate the database with it. Else, we will create some data manually and then dump it so that next time it is available. No cap. π¦
This trait requires a schema previously defined, such as provided by DBIx::Class::Migration::RunScript::Trait::SchemaLoader.
This trait is one of the defaults for the exported method migrate in DBIx::Class::Migration::RunScript. Periodt. π
π methods π
This class defines the following methods.
ποΈ dump ποΈ
Requires $arg || @args
Given a fixture set (or list of sets), use DBIx::Class::Fixtures to dump them from the current database.
When naming sets, you skip the .json extension. Tiny detail, big energy, bestie. π
π SEE ALSO π
DBIx::Class::Migration, DBIx::Class::Migration::RunScript β those are your next reads, fr fr. π
π«Ά AUTHOR π«Ά
See DBIx::Class::Migration for author information β that's the whole section, and we respect the mystery. π΅οΈββοΈπ
π COPYRIGHT & LICENSE π
See DBIx::Class::Migration for copyright and license information β read it, love it, respect it. βοΈπ
That's the page, bestie! This User Contributed Perl Documentation situation is running perl v5.42.0, dated 2020-06-03, and the footer is literally DBIx::C...t::Dump(3) β periodt. π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBIx-Class-Migration 0.075-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms