Storm::Source(3)
π Storm::Source π
okay bestie, so this is a page from the User Contributed Perl Documentation manual, and it's literally about Storm::Source β the class that always produces active database handles on request. no cap. it's giving "your dbh is always ready, always hydrated, never ghosting you" energy. π«Ά
β¨ NAME β¨
Storm::Source β always produces active database handles on request π
π SYNOPSIS π
here's the vibe, copy-paste ready:
use Storm::Source;
$source = Storm::Source->new(['DBI:mysql:database:3306', 'user', 'pass']);
$source = Storm::Source->new('@file.txt|record');
$dbh = $source->dbh;
likeβ¦ three ways in and one way out. iconic honestly. β
πΈ DESCRIPTION πΈ
so Storm::Source objects will return an active database handle on request. that's the whole personality. when you ask, you receive. π
the handle gets created using connection information stored internally, and β plot twist β that connection information can easily be retrieved from formatted ascii files. so you can keep your creds in a lil text file and let the object handle it. periodt. π
π¦ METHODS π¦
this class has the following methods:
π $class->new(\@connect_info)
the values inside \@connect_info are passed on to DBI->connect to create a database handler when one is requested. that's it, that's the whole job. you hand over the arrayref, it does the connecting when the time comes. π§
π $class->new('@file.txt|record')
you can also load the @connect_info arguments from a text file. the constructor will recognize anytime it is called with a singular argument starting with the @ character β that's your lil signal that it's file-loading time. πβ¨
the format of the file containing the connect arguments is:
- one record per line
- record name and connect args separated with a pipe character
- the individual connect arguments separated by tab characters
EX:
record1|DBI:mysql:database:address:3306|username|password
record2|DBI:SQLite:dbname=:memory:
see how record1 gets a full mysql connect string plus user and pass, and record2 just casually spins up an in-memory SQLite? lowkey obsessed. ππ₯
π $source->dbh
if the $source object is aware of an active database connection, it will be returned. otherwise, a new database handler will be created from DBI->connect. so either way you're getting a handle β that's the main character energy we talked about. π
π AUTHOR π
Jeffrey Ray Hallock, <jeffrey dot hallock at gmail dot com>
(they wrote it, we respect it π«‘)
π COPYRIGHT & LICENSE π
Copyright 2010 Jeffrey Ray Hallock, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
fr fr, same terms as Perl itself β that's the whole license, bestie. go wild, just keep the terms. π
and that's the page!! π this shipped with perl v5.42.0 and was dated 2025-07-25 β so yeah, it's giving "still relevant, still slaying." mwah, bye bestie!! πβ¨π¦
π¦ where this page comes from
- fedora 43: perl-Storm 0.240-34.fc43 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms