SQL::Tr...ListAttr(3)
π NAME π
Hiiii bestie! Youβre looking at SQL::Tr...ListAttr(3) β yes, thatβs the manual name, and this is one of those User Contributed Perl Documentation pages. Itβs all about SQL::Translator::Role::ListAttr: context-sensitive list attributes. Thatβs the whole vibe. Slay. β¨
π SYNOPSIS π
package Foo;
use Moo;
use SQL::Translator::Role::ListAttr;
with ListAttr foo => ( uniq => 1, append => 1 );
π¦ DESCRIPTION π¦
Okay so this package gives you a variable Moo::Role for list attributes that are context-sensitive. Itβs literally right there in the name, bestie. π
π οΈ FUNCTIONS π οΈ
π ListAttr $name => %parameters;
This returns a Moo::Role providing an arrayref attribute named $name, and it wraps the accessor so itβs context-sensitive both for setting and getting. If no builder or default is provided, the default value is the empty list. Periodt.
On setting, the arguments are parsed using parse_list_arg in SQL::Translator::Utils, and the accessor will return an array reference or a list, depending on context. Itβs giving dual-threat accessor energy. π
Parameters
appendβ if true, the setter will append arguments to the existing ones, rather than replacing them. No deleting your old faves. π«Άuniqβ if true, duplicate items will be removed, keeping the first one seen. First come, first served, iconic behavior. β¨may_throwβ if accessing the attribute might throw an exception (e.g. from abuilderorisacheck), this should be set to make the accessor store the exception usingSQL::Translator::Role::Errorand returnundef. Safety first, bestie. πundef_if_emptyβ if true, and the list is empty, the accessor will returnundefinstead of a reference to an empty in scalar context. Empty-list behavior, handled. π
Unknown parameters are passed through to the has call for the attribute. So yeah, they get handed off. Not me explaining has call passthrough with full main-character focus. π
π SEE ALSO π
SQL::Translator::UtilsSQL::Translator::Role::Error
Mwah π β this iconic little page comes from perl v5.42.0, dated 2024-12-12, and its manual-page name is SQL::Tr...ListAttr(3). Byeeee bestie, go slay those context-sensitive list attributes! π
β¨πΈ
π¦ 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