NAME

FSpot::DbTool - An interface to the F-Spot database

SYNOPSIS

use FSpot::DbTool;
my $fsdb = FSpot::DbTool->new( 'db_file' => '~/.config/f-spot/photos.db' );

Parameters:

db_file            Override the default location for the database file
ignore_db_version  Normally this module is designed to work with a specific
                   version of the FSpot database. If your version is different
                   but you are sure you want to continue anyway, set this parameter.

DESCRIPTION Interface to FSpot database =head1 PROPERTIES

METHODS

new()

Object constructor.

load_tool( $tool_name )

Loads a tool (Moose::Role) which brings special database manipulation methods with it

compact_db()

Compacts the database with the VACUUM command

Usage:

$fs->compact_db();

backup_db( %params )

Backs up the database. If target is defined, it will write to there, otherwise like this:

Original:

~/.config/f-spot/photos.db

Backup:

~/.config/f-spot/photos.db.bak.0

Usage:

$fs->backup_db();

search( %params )

Returns (an array of) rows (all columns) of matching entries

Usage:

$fs->search( table  => $table,
             search => [ [ 'filename', 'LIKE', '%123%' ], [ .... ] ] );

update_photo( %params )

Update a photo in the database

Usage: $details = { 'filename' => $newname, 'base_uri' => $new_base_uri }; $fs->update_photo_version( photo_id => $id, details => $details );

update_photo_version( %params )

Update a version of a photo in the database

Usage: $details = { 'filename' => $newname, 'base_uri' => $new_base_uri }; $fs->update_photo_version( photo_id => $id, version_id => $version_id, details => $details );

add_tag( %params )

Add a tag. Parent name is optional. If not defined, the tag will be attached to the root.

Usage:

$fs->add_tag( name        => $name,
              parent_name => $parent_name );

tag_photo( %params )

Tag a photo

Usage:

$fs->tag_photo( photo_id => $photo_id,
                tag_id   => $tag_id );

untag_all( %params )

Remove all of these tag links

Usage:

$fs->untag_all( tag_id => $tag_id );

column_exists( %params )

Test if the column exists for this table Returns 1 if it does, undef if not

Usage:

$fs->column_exists( table  => $table,
                    column =>  $column );

column_must_exist( %params )

Returns 1 if the table/column exists, dies if it doesn't

Usage:

$fs->column_must_exist( table  => $table,
                        column =>  $column );

AUTHOR

Robin Clarke perl@robinclarke.net

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc FSpot::DbTool

You can also look for information at:

ACKNOWLEDGEMENTS

http://f-spot.org/

LICENSE AND COPYRIGHT

Copyright 2010 Robin Clarke.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.