NAME
DBIC::Dumper - The great new DBIC::Dumper!
VERSION
Version 0.01
SYNOPSIS
DBIC::Dumper exports database data to yaml,xml or json.
Dumping data with DBIC::Dumper::YAML
package MyDB::Schema;
use base qw/DBIx::Class::Schema::Loader/;
__PACKAGE__->loader_options(relationships => 1, debug => 0);
my $db = MyDB::Schema->connect('SQLite:./somedb.db');
if(!defined $db) {
print "Can't connect to database!\n";
exit(0);
}
use DBIC::Dumper::YAML;
my $dumper = DBIC::Dumper::YAML->new();
# make sure to have the fixtures directory present
$dumper->dump_all($db,'fixtures');
# or you can export an individual DBIx::Class instance
$dumper->dump($db->resultset('SomeDB::Articles')->first());
Loading Data with DBIC::Dumper::YAML
package MyDB::Schema;
use base qw/DBIx::Class::Schema::Loader/;
__PACKAGE__->loader_options(relationships => 1, debug => 0);
my $db = MyDB::Schema->connect('SQLite:./somedb.db');
if(!defined $db) {
print "Can't connect to database!\n";
exit(0);
}
use DBIC::Dumper::YAML;
my $dumper = DBIC::Dumper::YAML->new();
# make sure fixtures directory is present.
$dumper->load($db,'fixtures');
EXPORT
A list of functions that can be exported. You can delete this section if you don't export anything, such as for a purely object-oriented module.
FUNCTIONS
new
process_table_columns
build_hash
dump
AUTHOR
Victor Igumnov, <victori at lamer0.com>
BUGS
Please report any bugs or feature requests to bug-dbic-dumper at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIC-Dumper. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc DBIC::Dumper
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2007 Victor Igumnov, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.