NAME

DiaColloDB::Upgrade - DiaColloDB utilities: auto-magic upgrades: top level

SYNOPSIS

use DiaColloDB::Upgrade;

@packages = $CLASS_OR_OBJECT->available();
@needed   = $CLASS_OR_OBJECT->needed($dbdir,  \%opts?, @packages);
@which    = $CLASS_OR_OBJECT->which($dbdir,   \%opts?, @packages);
$bool     = $CLASS_OR_OBJECT->upgrade($dbdir, \%opts?, @packages);

DESCRIPTION

DiaColloDB::Upgrade is a convenience package for performing automatic in-place upgrades to DiaColloDB database directories, used by the dcdb-upgrade.perl script included in the DiaColloDB distribution.

Globals

Variable: @ISA

DiaColloDB::Upgrade inherits from DiaColloDB::Logger.

Variable: @upgrades

An ARRAY of available automagic upgrade sub-packages (DiaColloDB::Upgrade:: suffixes).

Top-level

available
@upgrades = $CLASS_OR_OBJECT->available();

Returns list of available upgrade-packages (DiaColloDB::Upgrade:: suffixes).

needed
@needed = $CLASS_OR_OBJECT->needed($dbdir, \%opts?, @packages);

Returns list of those upgrade-packages in @packages which are applicable to the local DiaColloDB index in $dbdir. %opts are passed to upgrade-package new() methods.

which
@which = $CLASS_OR_OBJECT->which($dbdir, \%opts?);

Returns a list of upgrades previously applied to $dbdir. Returned list is created by parsing "upgraded" field from "$dbdir/header.json". If the upgrade-item "by" keyword is the name of a package inheriting from DiaColloDB::Upgrade::Base, a new object will be created and appended to the returned list; otherwise the parsed HASH-ref is returned as-is. %opts are passed to upgrade-package new() methods.

upgrade
$bool = $CLASS_OR_OBJECT->upgrade($dbdir, \%opts?, \@upgrades_or_pkgs);

Force-applies upgrades in @upgrades to the local DiaColloDB index in $dbdir; %opts are passed to upgrade-package new() methods.

AUTHOR

Bryan Jurish <moocow@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2016-2020 by Bryan Jurish

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.

SEE ALSO

dcdb-upgrade.perl(1), DiaColloDB::Upgrade::Base(3pm), DiaColloDB::Upgrade::v0_04_dlimits(3pm), DiaColloDB::Upgrade::v0_09_multimap(3pm), DiaColloDB::Upgrade::v0_10_x2t(3pm), DiaColloDB(3pm), perl(1), ...