App::diffdb - Compare two databases, line by line
This document describes version 0.004 of App::diffdb (from Perl distribution App-diffdb), released on 2020-05-06.
See included scripts diffdb, diffdb-sqlite, ...
Usage:
diffdb(%args) -> [status, msg, payload, meta]
Compare two databases, line by line.
This function is not exported.
Arguments ('*' denotes required arguments):
dbh1 => obj
Alternative to specifying dsn1/user1/password1.
dbh2 => obj
Alternative to specifying dsn2/user2/password2.
diff_command => str (default: "diff")
dsn1 => str
DBI data source, e.g. "dbi:SQLite:dbname=/path/to/db1.db".
dsn2 => str
exclude_columns => array[str]
exclude_tables => array[str]
include_columns => array[str]
include_tables => array[str]
order_by => str
password1 => str
You might want to specify this parameter in a configuration file instead of directly as command-line option.
password2 => str
Will default to password1 if password1 is specified.
password1
row_as => str (default: "json-one-line")
sql => str
Compare the result of SQL select query, instead of tables.
user1 => str
user2 => str
Will default to user1 if user1 is specified.
user1
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
diffdb_sqlite(%args) -> [status, msg, payload, meta]
Compare two SQLite databases, line by line.
dbpath1 => filename
First SQLite database file.
dbpath2 => filename
Second SQLite database file.
diffdbtable(%args) -> [status, msg, payload, meta]
Compare two database tables, line by line.
sql1 => str
sql2 => str
table1 => str
table2 => str
diffdbtable_sqlite(%args) -> [status, msg, payload, meta]
Compare two SQLite database tables, line by line.
Bool. If set to true, temporary directory is not cleaned up at the end of runtime.
Please visit the project's homepage at https://metacpan.org/release/App-diffdb.
Source repository is at https://github.com/perlancar/perl-App-diffdb.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-diffdb
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
diff-db-schema from App::DiffDBSchemaUtils which presents the result structure from DBIx::Diff::Schema directly.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::diffdb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::diffdb
CPAN shell
perl -MCPAN -e shell install App::diffdb
For more information on module installation, please visit the detailed CPAN module installation guide.