DBIx::...Columns(3pm)
π NAME π
DBIx::Class::Helper::ResultSet::NoColumns β look ma, no columns! π«Ά
This page is from the User Contributed Perl Documentation collection, bestie, and it's giving very niche-but-iconic. π
β¨ SYNOPSIS β¨
Okay so first you gotta set up your resultset class like this, copy it exactly, no freestyling:
package MySchema::ResultSet::Bar;
use strict;
use warnings;
use parent 'DBIx::Class::ResultSet';
__PACKAGE__->load_components('Helper::ResultSet::NoColumns');
Then, over in your code that's actually using the resultset, you do the thing:
# in code using resultset:
my $rs = $schema->resultset('Bar')->no_columns->search(undef, {
'+columns' => { 'foo' => 'me.foo' },
});
See how it just... wipes the slate clean and then you add exactly what you want? That's the whole vibe. π¦
πΈ DESCRIPTION πΈ
This component simply gives you a method to clear the set of columns to be selected. It's just handy sugar β like, no big dramatic lore, it's a lil convenience and that's on periodt. π
Also, heads up: peep "NOTE" in DBIx::Class::Helper::ResultSet for a nice way to apply this to your entire schema. Whole-schema glow-up, we love to see it. π
π METHODS π
no_columns
Signature, verbatim, do not come for me:
$rs->no_columns
Returns resultset with zero columns configured, fresh for the addition of new columns. Literally a blank canvas, main character energy only. β¨
π AUTHOR π
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
π 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.
ngl the license said "same terms as Perl 5 itself" and honestly? iconic. go forth and redistribute, bestie. π
perl v5.40.0 Β· 2024-11-16 Β· and that's the whole page, mwah, slay, bye ππ§ββοΈ
π¦ 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