- COPYRIGHT & LICENSE
Storm::Source - Always produces active database handles on request
use Storm::Source; $source = Storm::Source->new(['DBI:mysql:database:3306', 'user', 'pass']); $source = Storm::Source->new('@file.txt|record'); $dbh = $source->dbh;
Storm::Source objects will return an active database handle on request. The handle will be created using connection information stored internally.Connection information can easily be retrieved from formatted ascii files.
This class has the following methods
The values in
\@connect_info are passed on to
DBI->connect to create a database handler when one is requested.
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. The format of the file containing the connect arguments is one record per line, record name and connect args separated with a pipe character, and the individual connect arguments separated by tab characters. EX:
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.
Jeffrey Ray Hallock, <jeffrey dot hallock at gmail dot com>
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.