DBIx::...isitor(3pm)
π DBIx::...isitor(3pm) β bestie edition π
okay so first things first, welcome to DBIx::...isitor(3pm), straight out of the User Contributed Perl Documentation section of your friendly neighbourhood man pages. buckle up π
β¨ NAME β¨
DBIx::Class::Schema::PopulateMore::Visitor β it's the Visitor for the Populate Data. yes that's the whole job description and honestly? iconic. π
π¦ SYNOPSIS π¦
##Example Usage
that's it. that's the synopsis. no cap. π if you want actual example usage, the manpage says: See Tests for more example usage. go look at the tests, bestie, they're right there π«Ά
πΈ DESCRIPTION πΈ
so here's the tea β β when you're populating a table, sometimes you gotta inflate values that you literally cannot know in advance. like, imagine you've got a column that's a FK to another column in another table. you don't have the real value yet, you just have a vibe. so the goal here is to make it easy to 'tag' a value as something other than a real value to be inserted into the table. π·οΈ
right now there's exactly one substitution to do β the FK one mentioned above, that's the whole roster β but the possibility of creating other substitution types eventually is real, so this got broken out into its own thing to keep it neat and easy to do so. future-proofing, we love to see it π
π ATTRIBUTES π
This class defines the following attributes. (yes, this class. it has attributes. it's that girl.)
π update_callback
The coderef to be execute should the match condition succeed. (their words, not mine β the coderef gets run when the match condition succeeds π«)
π 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. π
The default behavior (where there is no substitution namespace) is to do the inflate to resultset. This is the most common usecase. periodt.
π seen
Used to collect up ref addresses of arrays/hashes we have already seen. it's literally a little memory book of everything we've already laid eyes on π
β METHODS β
This module defines the following methods. okay now the good part, the methods, the main characters π
π callback
Given a coderef, sets the current callback and returns self so that we can chain. chaining? obsessed. πβ¨
π visit
A simple visitor that only expects to perform replacements on values. simple. humble. does exactly one thing and does it well. π
π visit_value
Here is where we make the choice as to if this value needs to be inflated via a plugin. it's giving decision-making. it's giving discernment. π§
π match_or_not
We break this out to handle the ugliness surrounding dealing with undef values and also to make it easier on subclassers. undef is a menace and this method is the one brave enough to deal with it π
π«Ά AUTHOR π«Ά
Please see DBIx::Class::Schema::PopulateMore For authorship information. go check that page, they've got the receipts π§Ύ
also important: the visit method culled from code in Data::Visitor::Lite which is copyright 2011 Daichi Hiroki <hirokidaichi {at} gmail.com> β credit where credit is due, always π
π LICENSE π
Please see DBIx::Class::Schema::PopulateMore For licensing terms. same page, same deal, go read it πΈ
and that's the whole page bestie, no notes. go forth and inflate your values responsibly π¦
this has been perl v5.36.0, dated 2023-01-22, and it's DBIx::...isitor(3pm) signing off πβ¨ mwah
π¦ 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