DBIx::...umnInfo(3pm)
π NAME π
DBIx::Class::Helper::Schema::Verifier::ColumnInfo β bestie, this one checks that your Results only use column_info keys that got the stamp of approval. No sneaky random keys allowed, periodt. β¨
Oh and hey, real quick before we dive in: this is a User Contributed Perl Documentation page, so you know it's coming straight from the community with love. π«Ά
πΈ SYNOPSIS πΈ
package MyApp::Schema;
__PACKAGE__->load_components('Helper::Schema::Verifier::ColumnInfo');
# optionally add some non-standard allowed keys
sub allowed_column_keys {
my $self = shift;
my @keys = $self->next::method;
push @keys, qw(is_serializable keep_storage_value remove_column);
return @keys;
}
like. it's that easy. load the component, and optionally flex your own allowed keys. π
π¦ DESCRIPTION π¦
okay so DBIx::Class::Helper::Schema::Verifier::ColumnInfo verifies that none of your columns are out here using non-approved configuration keys. literally none. π
here's the tea: DBIx::Class does zero key verification. zero!! so this Helper exists so you don't get absolutely burned by a typo β you know the vibe, writing autoincrement when you clearly meant is_auto_increment. π
and if your schema does use a non-approved column config key? it will refuse to load, no cap. instead it hits you with a hopefully-helpful message pointing out exactly where the error is. it's giving supportive bestie energy honestly. π
β METHODS β
β¨ allowed_column_keys()
so it's entirely possible β and like, very valid β that you want to use some non-default config keys. especially if you're running some column-extension components, iykyk. π
to do that: override this method in your schema and append your new keys to the list returned by the superclass call. and listen β the overridden method must return a list of keys. that part's non-negotiable bestie. π
sub allowed_column_keys {
my $self = shift;
my @keys = $self->next::method;
# modify @keys as needed
return @keys;
}
π 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.
ok that's the whole page bestie, go forth and verify those column keys π
and a lil cute sign-off for the record: this page came from perl v5.40.0, dated 2024-11-16, and it's filed under DBIx::...umnInfo(3pm) in your friendly local manual. 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