DBIx::...Columns(3pm)

πŸ“¦
version 2.037000 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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>


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