DBIx::...ommand(3pm)
β¨ DBIx::Class::Schema::PopulateMore::Command β¨
okay bestie, so this whole page is the manual for DBIx::Class::Schema::PopulateMore::Command β a Command Class to Populate a Schema, straight out of the User Contributed Perl Documentation section. pull up a chair, we're doing this together π
πΈ NAME πΈ
DBIx::Class::Schema::PopulateMore::Command β Command Class to Populate a Schema. that's it, that's the name, she's serving exactly what it says on the tin π
π¦ DESCRIPTION π¦
so this is a command pattern class, and her whole job is managing the populating of a DBIx::Class::Schema with information. literally her entire purpose. iconic behavior.
and why did we break it out into its own little class instead of just vibing inside something bigger? three reasons, bestie:
- the actual job is a bit complex π
- it's likely to grow more complex (she's expanding, she's in her growth era)
- so that we can more easily identify refactorable and reusable parts π₯
basically: we separated her out so future-us can find the reusable bits without crying. periodt.
π ATTRIBUTES π
this class defines the following attributes, and we're going through every single one, no skipping:
π schema
This is the Schema we are populating. that's the whole description, she's straightforward and we respect that.
π exception_cb
contains a callback to the exception method supplied by DBIC π«Ά
π definitions
This is an arrayref of information used to populate tables in the database.
π match_condition
How we know the value is really something to inflate or perform a substitution on. This get's the namespace of the substitution plugin and it's other data.
π visitor
We define a visitor so that we can perform the value inflations and or substitutions. This is still a little work in progress, but it's getting neater β¨ (her words, not mine β she's still cooking, but she's coming along)
π rs_index
The index of previously inflated resultsets. Basically when we create a new row in the table, we cache the result object so that it can be used as a dependency in creating another.
Eventually will be moved into the constructor for a plugin. (future plans, bestie, we're manifesting it π)
π set_rs_index
Set an index value to an inflated result.
π get_rs_index
given an index, returns the related inflated resultset. the classic getter/setter duo, we love to see it π
π inflator_loader
Loads each of the available inflators, provider access to the objects.
π inflator_dispatcher
Holds an object that can perform dispatching to the inflators.
π METHODS π
This module defines the following methods. buckle up, there's a bunch.
π _build_visitor
lazy build for the visitor attribute. lazy but make it functional, we stan π§
π _build_inflator_loader
lazy build for the inflator_loader attribute.
π _build_inflator_dispatcher
lazy build for the inflator_dispatcher attribute.
π execute
The command classes main method. Returns a Hash of the created result rows, where each key is the named index and the value is the row object. this is the main character right here, no cap π
π dispatch_inflator
Dispatch to the correct inflator. short, sweet, does exactly one thing.
π create_fixture({})
Given a hash suitable for a DBIx::Class::Resultset create method, attempt to update or create a row in the named source.
returns the newly created row or throws an exception if there is a failure π so like, handle your errors, bestie.
π merge_fields_values
Given a fields and values, combine to a hash suitable for using in a create_fixture row statement.
π field_value
Correctly create an array from the fields, values variables, skipping those where the value is undefined.
π coerce_to_array
given a value that is either an arrayref or a scalar, put it into array context and return that array. coercion but make it cute π¦
π AUTHOR π
Please see DBIx::Class::Schema::PopulateMore For authorship information.
π LICENSE π
Please see DBIx::Class::Schema::PopulateMore For licensing terms.
and that's the whole page, bestie!! we did it π
β¨ this was DBIx::...ommand from perl v5.36.0, dated 2023-01-22, and she ate and left no crumbs ππ¦πΈ love u, go populate that schema π
π¦ where this page comes from
- debian bookworm: libdbix-class-schema-populatemore-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdbix-class-schema-populatemore-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdbix-class-schema-populatemore-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-class-schema-populatemore-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-class-schema-populatemore-perl 0.19-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms