File::Sticker::Database - write info to database
version 1.0603
use File::Sticker::Database; my $db = File::Sticker::Database->new(%args); $db->write_meta(%args);
This will write meta-data from files in various formats, and standardize it to a common nomenclature.
Used for debugging info
Create a new object, setting global values for the object.
my $obj = File::Sticker::Database->new( dbname=>$dbname, wanted_fields=>\%wanted_fields, field_order=>\@field_order, primary_table=>$primary_table, );
Connect to the database if not connected already.
Create the tables for the database. Give them all prefixes so that multiple setups can use the same database.
Disconnect from the database
Start a transaction.
Commit a pending transaction.
$self->commit();
Get the fileid of the given file
my $fileid = $self->get_file_id($filename);
Get the meta-data for a single file.
$meta = $self->get_file_meta($file);
Return a list of all the files in the database.
my @files = @{$db->get_all_files()};
Return a list of all the tags from the appropriate "deep*" table.
my @tags = @{$db->get_all_tags()};
Use +tag -tag nomenclature for searching the database for matching files. If the *info table exists, uses that, otherwise, it uses the "tagfield" in the primary table.
Delete the record for one file from the database
$db->delete_file_from_db($filename);
Add the given file info to the database.
$db->add_meta_to_db($filename, %meta);
Private interface.
Return the name of the given deep_* table.
Do a SELECT query, and return the first column of results. This is a freeform query, so the caller must be careful to formulate it correctly.
my $results = $self->_do_one_col_query($query);
Prepare and cache prepared queries.
my $sth = $self->_prepare($q);
Please report any bugs or feature requests to the author.
To install File::Sticker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Sticker
CPAN shell
perl -MCPAN -e shell install File::Sticker
For more information on module installation, please visit the detailed CPAN module installation guide.