Data::...StagDB(3pm)
π Data::Stag::StagDB π
okay so bestie, welcome to Data::Stag::StagDB β a little Perl module (that's the (3pm) energy right there, it's a perl manpage from the User Contributed Perl Documentation collection, no cap) that does persistent storage and retrieval of stag nodes. yes. storing ur stag nodes. forever. main character behaviour honestly π
β¨ NAME β¨
Data::Stag::StagDB β persistent storage and retrieval of stag nodes. that's the whole vibe. storage, retrieval, persistence, nodes. slay π
πΈ SYNOPSIS πΈ
here's the tea, two whole ways to use it. first: parsing a file straight into a file based index π
# parsing a file into a file based index
my $sdb = Data::Stag::StagDB->new;
$sdb->unique_key("ss_details/social_security_no");
$sdb->record_type("person");
$sdb->indexfile("./person_by_ss-idx");
Data::Stag->parse(-file=>$fn, -handler=>$sdb);
my $obj = $sdb->index_hash;
my $person = $obj->{'999-9999-9999'};
print $person->xml;
# indexing an existing stag tree into a file based index
my $personset = Data::Stag->parse($fn);
my $sdb = Data::Stag::StagDB->new;
$sdb->unique_key("ss_details/social_security_no");
$sdb->record_type("person");
$sdb->indexfile("./person_by_ss-idx");
$personset->sax($sdb);
my $obj = $sdb->index_hash;
my $person = $obj->{'999-9999-9999'};
print $person->xml;
see how it's giving β¨same setup, different entry pointβ¨? one parses with a handler, one saxes an already-parsed tree. both end up with a $person and both print its xml. iconic. π
π¦ DESCRIPTION π¦
This module is an extension of Data::Stag::HashDB β you can use it in the same way. literally just HashDB but with β¨persistenceβ¨, iykyk.
It creates a simple file based database of stag nodes. simple! file based! database! of stag nodes! say it with me π«Ά
This is useful if you want your data to persist; or if you want to use Data::Stag::HashDB but your data will not fit into memory. like. ur data is too big for the RAM. it's not a skill issue, it's a size issue, and this module is the fix π₯
π PUBLIC METHODS - π
π indexfile π
Usageβ left blank in the original, bestie, it's giving mystery π«£Returnsβ also blank. we simply do not know. the void returns nothing πArgsβ blank as well. the args are a secret and honestly? respect π
fr fr that's all the original gives us here β three lil empty fields under indexfile. no invented lore, no made-up behaviour, we just hold space for the mystery π
and that's the page, bestie!! remember: Data::Stag::StagDB is a Data::Stag::HashDB extension, it makes a simple file based database of stag nodes, it's for when u want persistence or when ur data won't fit in memory. periodt π
perl v5.34.0 π 2022-06-12 β that's the version and date stamp of this little icon, mwah, go forth and index ur stag nodes ππ¦π
π¦ where this page comes from
- debian bookworm: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libdata-stag-perl 0.14-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms