DBIx::...elpers(3pm)
π DBIx::...elpers π
okay bestie, welcome to DBIx::Class::Helpers β the page that's literally just here to make DBIx::Class less of a whole ordeal. Think of it as the glow-up your schema deserved. We're talking DBIx::...elpers from the User Contributed Perl Documentation corner of the world, and yes, that truncated name is iconic, don't question it. π
β¨ NAME β¨
DBIx::Class::Helpers β Simplify the common case stuff for DBIx::Class. no cap, that's literally the whole mission statement π«Ά
π¦ SYNOPSIS π¦
here's the vibe, copy it, love it:
package MyApp::Schema::Result::Foo_Bar;
__PACKAGE__->load_components(qw{Helper::JoinTable Core});
__PACKAGE__->join_table({
left_class => 'Foo',
left_method => 'foo',
right_class => 'Bar',
right_method => 'bar',
});
# define parent class
package ParentSchema::Result::Bar;
use strict;
use warnings;
use parent 'DBIx::Class';
__PACKAGE__->load_components('Core');
__PACKAGE__->table('Bar');
__PACKAGE__->add_columns(qw/ id foo_id /);
__PACKAGE__->set_primary_key('id');
__PACKAGE__->belongs_to( foo => 'ParentSchema::Result::Foo', 'foo_id' );
# define subclass
package MySchema::Result::Bar;
use strict;
use warnings;
use parent 'ParentSchema::Result::Bar';
__PACKAGE__->load_components(qw{Helper::SubClass Core});
__PACKAGE__->subclass;
like, look at that. join table? handled. subclassing? handled. you barely lifted a finger. main character energy fr fr β¨
π SEE ALSO π
go read these next, they're the friend group:
DBIx::Class::Helper::Row::JoinTableDBIx::Class::Helper::Row::SubClassDBIx::Class::Helpers::Util
π AUTHOR π
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> β actual legend, gave us this whole thing π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
periodt. that's the whole page, and every last byte of it is here β nothing dropped, nothing skipped. π«Ά
and that's a wrap, bestie π this was DBIx::...elpers as shipped with perl v5.40.0, dated 2024-11-16 β go forth and make your schemas slay πΈπ¦β
π¦ where this page comes from
- debian trixie: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-class-helpers-perl 2.037000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-class-helpers-perl 2.037000-1 Β· 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