NAME
App::Manoc::DataDumper::Data - Class for managing datadumper file
VERSION
version 2.99.2
SYNOPSIS
$datadump = App::Manoc::DataDumper::Data->init( $filename, $version, $config );
[...]
foreach $source ( @datasources ) {
$table = $source->result_source->name;
@data = $source->all;
$datadump->add_file( "$table.yaml", \@data );
}
$datadump->save;
my $datadump = App::Manoc::DataDumper::Data->load( $self->filename );
my $version = $datadump->metadata->{'version'};
my $records = $datadump->load_file("$table.yml");
DESCRIPTION
Use this class to create or load data dumper files. A data dumper file is just a tar file containing a yaml files. Each yaml file contains a set of records for a DB table.
CLASS METHODS
load_file( $filename )
Open the yaml file $filename
from the manoc dump archive and return a reference to the array of records found on it.
init( $filename, $version, $config )
Create a new dumper file.
METHODS
load( $filename )
Load a manoc dump file.
add_file( $filename, $array_ref )
Add a $filename
file to the current dump serialing records form $array_ref
.
save
Create dump file, i.e. a tar file containing all the serialized record plus a metadata file.
AUTHORS
Gabriele Mambrini <gmambro@cpan.org>
Enrico Liguori
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Gabriele Mambrini.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.