| 146 | | ... |
| | 148 | DBIx::Replicate is a perl module that incrementally copies SQL tables using C<DBI> connections. The granuality and speed of the copy can be controlled. |
| | 149 | |
| | 150 | =head1 FUNCTIONS |
| | 151 | |
| | 152 | =head2 dbi_replicate |
| | 153 | |
| | 154 | A functional interface of DBIx::Replicate. Accepts following parameters through a hashref argument. |
| | 155 | |
| | 156 | =head3 src_conn |
| | 157 | |
| | 158 | C<DBI> connection to source database |
| | 159 | |
| | 160 | =head3 src_table |
| | 161 | |
| | 162 | name of the source table (mandatory) |
| | 163 | |
| | 164 | =head3 dest_conn |
| | 165 | |
| | 166 | C<DBI> connection to destination database (mandatory) |
| | 167 | |
| | 168 | =head3 dest_table |
| | 169 | |
| | 170 | name of the destination table (mandatory) |
| | 171 | |
| | 172 | =head3 columns |
| | 173 | |
| | 174 | an arrayref containing the name of columns to be copied (mandatory) |
| | 175 | |
| | 176 | =head3 extra_cond |
| | 177 | |
| | 178 | sql expression to filter rows to be copied (optional) |
| | 179 | |
| | 180 | =head3 load |
| | 181 | |
| | 182 | load average for the copy operation (optional). The value should be greater than 0 and less or equal to 1. |
| | 183 | |
| | 184 | =head3 copy_by |
| | 185 | |
| | 186 | optionally takes an arrayref of column names. If given, C<DBIx::Replicate::Strategy::CopyBy> will be used for copying tables. The strategy repeatedly copies a set of rows that contain identical values in the specified columns. |
| | 187 | |
| | 188 | =head3 primary_key |
| | 189 | |
| | 190 | optionally takes an arrayref of primary key column names. If given, C<DBIx::Replicate::Strategy::PK> will be used for copying tables. The strategy copies certain number of rows at once specified by parameter C<block>, in the order sorted by C<primary_key>. |
| | 191 | |
| | 192 | =head3 block |
| | 193 | |
| | 194 | used together with C<primary_key> to specify the number of rows copied at once |