DBIx::C...lBuilder(3)
π NAME π
okay so bestie, this is DBIx::Class::Schema::Loader::RelBuilder β it builds relationships for DBIx::Class::Schema::Loader. that's the whole vibe. the manual page title is DBIx::C...lBuilder(3) and it lives under "User Contributed Perl Documentation," for the record π
β¨ SYNOPSIS β¨
no big synopsis moment here, just a lil pointer:
SeeDBIx::Class::Schema::LoaderandDBIx::Class::Schema::Loader::Base.
go read those, iykyk π«Ά
π¦ DESCRIPTION π¦
so this class builds relationships for DBIx::Class::Schema::Loader. and like β real talk β this module is not (yet) for external use. meaning: it's an internal bestie, not a public-facing icon. don't @ me when you use it directly, okay? π
πΈ METHODS πΈ
π new
Arguments: $loader object
that's it, that's the whole vibe check. you hand it the loader, it's born. β
π generate_code
Arguments:
[
[ local_moniker1 (scalar), fk_info1 (arrayref), uniq_info1 (arrayref) ]
[ local_moniker2 (scalar), fk_info2 (arrayref), uniq_info2 (arrayref) ]
...
]
this generates the code for the relationships of each table. main character energy, honestly π₯
local_moniker is the moniker name of the table which had the REFERENCES statements. the fk_info arrayref's contents should take the form:
[
{
local_table => 'some_table',
local_moniker => 'SomeTable',
local_columns => [ 'col2', 'col3' ],
remote_table => 'another_table_moniker',
remote_moniker => 'AnotherTableMoniker',
remote_columns => [ 'col5', 'col7' ],
},
{
local_table => 'some_other_table',
local_moniker => 'SomeOtherTable',
local_columns => [ 'col1', 'col4' ],
remote_table => 'yet_another_table_moniker',
remote_moniker => 'YetAnotherTableMoniker',
remote_columns => [ 'col1', 'col2' ],
},
# ...
],
the uniq_info arrayref's contents should take the form:
[
[
uniq_constraint_name => [ 'col1', 'col2' ],
],
[
another_uniq_constraint_name => [ 'col1', 'col2' ],
],
],
this method will return the generated relationships as a hashref keyed on the class names. the values are arrayrefs of hashes containing method name and arguments, like so:
{
'Some::Source::Class' => [
{ method => 'belongs_to', arguments => [
'col1', 'Another::Source::Class' ] },
{ method => 'has_many', arguments => [
'anothers', 'Yet::Another::Source::Class', 'col15' ] },
],
'Another::Source::Class' => [
# ...
],
# ...
}
a whole lil relationship map, handed to you in a hashref. slay. π
π AUTHORS π
See "AUTHORS" in DBIx::Class::Schema::Loader.
the whole squad is credited over there, go give them their flowers π«ΆπΈ
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay and the tiny fine print at the bottom of the page? that's perl v5.42.0, dated 2025-07-25, filed under DBIx::C...lBuilder(3) β iconic, no cap, periodt π
β¨π§
π¦ where this page comes from
- fedora 43: perl-DBIx-Class-Schema-Loader 0.07053-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms