NAME

Geoffrey::Changelog::Database - module for Geoffrey::Changelog to load changeset from database tables.

VERSION

Version 0.000202

DESCRIPTION

SYNOPSIS

    my $o_geoffrey = Geoffrey->new(
        dbh            => $o_handle,
        converter_name => 'Pg',
        io_name        => 'Database'
    );

    # the dot is to fake the root directory, which is not needed becaues of database
    my $s_user = 'Mario Zieschang';
    my $s_sql = 'SELECT 1;';
    my $s_changeset_id = time . '-' . $s_user
    $o_geoffrey->insert( q~.~, {
        author  => $s_user,
        id      => $s_changeset_id,
        name    => 'Some createative name',
        entries => [{action => 'sql.add', as => $s_sql}],
    });

    my $hr_changeset = $o_geoffrey->changelog_io->load($s_changeset_id);
    
    # changesets are stored in the geoffrey table but without md5sum. 
    # run the changeset will set it
    $o_geoffrey->reader->run_changeset($hr_get_changeset, delete $hr_get_changeset->{filename});

    # changesets without md5sum can be deleted without effect
    $o_geoffrey->delete($s_changeset_id);

SUBROUTINES/METHODS

new

file_extension

load

Called to load changesets from database

write

A wrapper for insert

converter

Instantiates Geoffrey::Converter::... object if none is the in the internal key 'converter' and returns it. converter SQLite is default if no changeset_converter is given in the constructor.

dbh

Contains the given dbi session

geoffrey_changelogs

Returns the geoffrey_changelogs table name because it's needed for feference

schema

Some Databases are using different schemas e.g. to categorize. If you need to store your datas in a special schema you can set it here

delete

Geoffrey::Changelog::Database is able to delete a changeset by id as long it's not executed

insert

Called to write changesets to database

load_changeset

Get the value of a changeset by given changeset id.

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

DEPENDENCIES

INCOMPATIBILITIES

BUGS AND LIMITATIONS

Please report any bugs or feature requests to bug-Geoffrey at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geoffrey. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

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

    perldoc Geoffrey::Changelog::Database

You can also look for information at:

AUTHOR

Mario Zieschang, <mziescha at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2015 Mario Zieschang.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, trade name, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.