Kazuho Oku > DBIx-Replicate-0.02 > DBIx::Replicate

Download:
DBIx-Replicate-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.02   Source  

NAME ^

DBIx::Replicate - Synchornizes an SQL table to anther table

SYNOPSIS ^

  use DBIx::Replicate qw/dbix_replicate/;
  
  # incrementally copy table to other database (copy by each zipcode)
  dbix_replicate({
    src_conn     => $src_dbh,
    src_table    => 'tbl',
    dest_conn    => $dest_dbh,
    dest_table   => 'tbl',
    copy_by      => [ qw/zipcode/ ],
  });
  
  # incrementally extract (by every 1000 rows) people younger than 20 years old
  dbix_replicate({
    src_conn     => $dbh,
    src_table    => 'all_people',
    dst_conn     => $dbh,
    dest_table   => 'young_people',
    primary_keys => [ qw/id/ ],
    columns      => [ qw/id name age/ ],
    block        => 1000,
    extra_cond   => 'age<20',
  });


  # OO interface
  my $dr = DBIx::Replicate->new(
    src => DBIx::Replicate::Node->new(...)
    dest => DBIx::Replicate::Node->new(...)
    strategy => DBIx::Replicate::Strategy::PK->new()
  );
  $dr->replicate();

DESCRIPTION ^

...

AUTHOR ^

Kazuho Oku

COPYRIGHT AND LICENSE ^

Copyright (C) 2008 Cybozu Labs, Inc.

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