Class::...nGrouper(3)

πŸ’– NAME πŸ’–

okay so bestie, this is the Class::...nGrouper(3) manual page from User Contributed Perl Documentation β€” and it's all about Class::DBI::ColumnGrouper, aka Columns and Column Groups. periodt. πŸ’…

✨ SYNOPSIS ✨

        my $colg = Class::DBI::ColumnGrouper->new;
           $colg->add_group(People => qw/star director producer/);

        my @cols = $colg->group_cols($group);

        my @all            = $colg->all_columns;
        my @pri_col        = $colg->primary;
        my @essential_cols = $colg->essential;

πŸ¦‹ DESCRIPTION πŸ¦‹

So every Class::DBI class keeps a list of its columns as class data, and this thing gives you an interface to that list. Real talk: you probably don't want to be dealing with this directly. no cap. πŸ™ˆ


🌸 METHODS 🌸

πŸŽ€ new πŸŽ€

my $colg = Class::DBI::ColumnGrouper->new;

This makes a new blank ColumnnGrouper object. yes, it says ColumnnGrouper β€” iconic spelling, we keep it exactly as-is. 😭

🧚 clone 🧚

my $colg2 = $colg->clone;

Clone an existing ColumnGrouper. slay, copy that vibe. ✨

πŸ’œ add_column / find_column πŸ’œ

$colg->add_column($name);
my Class::DBI::Column $col = $colg->find_column($name);

Add or return a Column object for the given column name. that's the whole job, bestie. 🫢

🌈 add_group 🌈

$colg->add_group(People => qw/star director producer/);

This adds a list of columns as a column group. group chat but make it database columns. πŸ‘‘

πŸ“ group_cols / groups_for πŸ“

my @colg = $cols->group_cols($group);
my @groups = $cols->groups_for(@cols);

This returns a list of all columns which are in the given group, or the groups a given column is in. both directions, very main character energy. πŸ”₯

⭐ columns_in ⭐

my @cols = $colg->columns_in(@groups);

This returns a list of all columns which are in the given groups. lowkey useful, highkey specific. πŸ’«

πŸ’€ all_columns πŸ’€

my @all = $colg->all_columns;

This returns a list of all the real columns. not the fake ones, the real ones. 🫑

πŸ‘‘ primary πŸ‘‘

my $pri_col = $colg->primary;

This returns a list of the columns in the Primary group. and yes, the code says my $pri_col even though it returns a list β€” we don't make the rules, we just report them. πŸ’…

🌸 essential 🌸

my @essential_cols = $colg->essential;

This returns a list of the columns in the Essential group. essential, literally. πŸŽ€


πŸ’– that's the whole page, bestie β€” Class::...nGrouper(3) from perl v5.42.0, dated 2011-04-08. bye and slay 🫢✨

πŸ“¦ where this page comes from