SQL::Admin - Maintain database schemas
use SQL::Admin; # Merge multiple SQL files my $catalog = SQL::Admin ->get_catalog ->load ('DB2', { file => [ 'create-schema.sql', 'update-001.sql' ] }) ->save ('Pg', { file => [ 'output.sql' ] }); # ... deploy catalog $catalog->save ('Pg::DBI', { dbdsn => ... }); # Sync SQL files and db my $src = SQL::Admin->get_catalog; ->load ('Pg::DBI', { dbdsn => ... }); my $dst = SQL::Admin->get_catalog; ->load ('Pg', { file => [ 'create-schema.sql' ] }); my $diff = SQL::Admin->compare ($src, $dst); if ($diff->is_difference) { $diff->save ('Pg'); $diff->save ('Pg::DBI', { dbdsn => ... }); }
To install SQL::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::Admin
CPAN shell
perl -MCPAN -e shell install SQL::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.