SQL::Tr...::Extra(3)
π NAME π
okay bestie, meet SQL::Translator::Schema::Role::Extra β the page is shortened to SQL::Tr...::Extra(3) up top, but the full module name is the whole thing. It's the role that gives schema classes their "extra" attribute. That's the vibe. π
β¨ SYNOPSIS β¨
To pull it into a class, you literally do this:
package Foo;
use Moo;
with qw(SQL::Translator::Schema::Role::Extra);
π DESCRIPTION π
This role provides methods to set and get a hashref of extra attributes for schema objects. No cap, it's the little sidecar of extra data for schema stuff. π¦
π§ METHODS π§
π₯ extra π₯
Use this to get or set the object's "extra" attributes β think "ZEROFILL" for MySQL fields, iykyk. Here's the rundown:
- Call with no args to get all the extra data.
- Call with a single name arg to get the value of the named extra attribute, returned as a scalar.
- Call with a hash or hashref to set extra attributes.
It returns a hash or a hashref. Very demure, very flexible. π
Examples, exact:
$field->extra( qualifier => 'ZEROFILL' );
$qualifier = $field->extra('qualifier');
%extra = $field->extra;
$extra = $field->extra;
π remove_extra π
Plot twist: "extra" can only be used to get or set "extra" attributes β it can't remove some. That's why remove_extra exists, bestie. π«Ά
- Call with no args to remove all extra attributes that have been set before.
- Call with a list of key names to remove certain extra attributes only.
Examples:
# remove all extra attributes
$field->remove_extra();
# remove timezone and locale attributes only
$field->remove_extra(qw/timezone locale/);
mwah π β this page came from User Contributed Perl Documentation, version perl v5.42.0, dated 2024-12-12, and yes the page is SQL::Tr...::Extra(3). Stay iconic. ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-SQL-Translator 1.660.0-bp160.1.11 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms