Data::...StagDB(3pm)

πŸ“¦
version 0.14 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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