DBIx::...umnInfo(3pm)

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

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


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