DBIx::Class::Helper::Schema::Verifier::ColumnInfo(3pm)

DBIx::Class::Helper::Schema::Verifier::ColumnInfo3pm

Verify that results only use approved column_info keys

Usage

 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;
 }

Overview

"DBIx::Class::Helper::Schema::Verifier::ColumnInfo" verifies that none of your columns use non-approved configuration keys. DBIx::Class doesn't do any key verification, so this Helper makes sure you don't get burned by a typo like using "autoincrement" instead of "is_auto_increment". If your schema uses a non-approved column config key, it will refuse to load and instead offer a hopefully helpful message pointing out the error.

Methods

allowed_column_keys()

It's entirely possible that you would like to use some non-default config keys, especially if you use some column-extension components. Override this method in your schema and append your new keys to the list returned by the superclass call. The overridden method must return a list of keys.

 sub allowed_column_keys {
   my $self = shift;
   my @keys = $self->next::method;
   # modify @keys as needed
   return @keys;
 }

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

Arthur Axel "fREW" Schmidt <[email protected]>

From libdbix-class-helpers-perl 2.037000-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.