Sympa::DataSource(3Sympa)
π Sympa::DataSource β the base class glow-up β¨
okay bestie, this is Sympa::DataSource(3Sympa) from the sympa 6.2.80 manual, and she is the mother of all the data source subclasses. every data source subclass in Sympa is her daughter, and she's here to serve the inheritance π
πΈ NAME πΈ
Sympa::DataSource β the base class of the Sympa data source subclasses. like, the blueprint. the blueprint-est blueprint. everything else is just building on her foundation, periodt π
β¨ SYNOPSIS β¨
so first, if you're out here trying to implement Sympa::DataSource::Foo, it's giving:
# To implemnt Sympa::DataSource::Foo:
package Sympa::DataSource::Foo;
use base qw(Sympa::DataSource);
sub _open {
my $self = shift;
...
return $handle;
}
sub _next {
my $self = shift;
...
return [$email, $gecos];
}
1;
(no I did not fix the typo in the comment. the typo stays. we respect the original here, no cap π«Ά)
and using it? also iconic:
# To use Sympa::DataSource::Foo:
usr Sympa::DataSource;
$ds = Sympa::DataSource->new('Foo', 'member', context => $list,
key => val, ...);
if ($ds and $ds->open) {
while (my $member = $ds->next) {
...
}
$ds->close;
}
π¦ DESCRIPTION π¦
TBD.
... yeah. that's literally all she wrote. the description is β¨to be determinedβ¨. we love a mysterious queen who says nothing and yet does everything π
π Methods π
new ( $type, $role, context => $that, [ key => val, ... ] )
the constructor, bestie. makes you a fresh new instance of Sympa::DataSource like it's a new semester π
Parameters:
$typeβ the type of data source. this maps to whatever subclasses actually got implemented, iykyk.$roleβ the role of the data source. she's serving one of:'member','owner','editor'or'custom_attribute'. pick your lane πcontext => $thatβ the context. aSympa::Listinstance and so on. the vibe setter.key => val, ...β optional or mandatory params, depending on the mood.
Returns:
a new instance, or undef on failure π (crying, throwing up, but make it a failed constructor).
close ( )
instance method. closes the backend and does the cleanup. she's logging off π§
is_external ( )
instance method. returns a true value if the data source is an external data source. "external" means it's not include_sympa_list (aka not an instance of Sympa::DataSource::List) or not including any lists on the local domain.
Known bug:
- If a data source is a list included from the other external data source(s), this method will treat it as non-external, so that some requests not allowed for external data sources β such as
move_userrequest β on corresponding users may be allowed. π so yeah, that's a permissions oopsie, and per the manual it's a known bug. be aware.
next ( )
instance method. returns the next entry in the data source. the data source should have been opened first, bestie β don't skip the open, it's not a vibe β
open ( )
instance method. opens the backend and returns a handle. like opening a group chat π¬
get_id ( )
instance method. gets the unique ID of the instance. one of one π₯
get_short_id ( )
instance method. gets the data source ID, a hexadecimal string with 8 columns. cute and compact π
name ( )
instance method. gets the human-readable name of the data source. typically it's the value of {name} attribute or the result of get_short_id(). aesthetic AND functional, we stan πΈ
role ( )
instance method. returns $role set by new(). she remembers who she is π
__dsh ( )
instance method, protected. returns the native query handle which _open() returned. this may be used only at inside of each subclass β like, stay in your house, this is family business π
π Methods subclass should implement π
required_modules
class or instance method. TBD.
_open ( [ options... ] )
instance mthod. TBD.
(yes, "mthod". the typo is part of the lore now. π§)
_next ( [ options... ] )
instance method, mandatory. TBD. like she's required and still says TBD. β main character energy fr fr β
_next_ca ( [ options... ] )
instance method, mandatory if the data source supports custom attribute. TBD.
_close ( )
instance method. TBD.
π Attributes π
{context}
the context of the data source set by new().
Others
the other options set by new() may be accessed as attributes. surprise! everything's an attribute if you believe hard enough π«
π HISTORY π
Sympa::DataSource appeared on Sympa 6.2.45b. see also "HISTORY" in Sympa::Request::Handler::include. she's been around, she's got lore π
lowkey reminder bestie: every option, method, param and typo up there is verbatim from the page. I just gave it a wardrobe change. the facts did not move. π
and that's a wrap on Sympa::DataSource(3Sympa) from sympa version 6.2.80, dated 2026-10-19 π
β¨ slay, stay safe, and always call $ds->close when you're done π«ΆπΈ
π¦ where this page comes from
- fedora 43: sympa-devel-doc 6.2.80-2.fc43 Β· GPL-2.0-or-later AND (OFL-1.1-RFN AND MIT) AND OFL-1.1-RFN AND MIT and (MIT OR GPL-2.0-only)
- fedora 44: sympa-devel-doc 6.2.80-2.fc44 Β· GPL-2.0-or-later AND (OFL-1.1-RFN AND MIT) AND OFL-1.1-RFN AND MIT and (MIT OR GPL-2.0-only)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms