-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
30 lines (22 loc) · 814 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
NAME
SQL::Admin - Maintain database schemas
SYNOPSIS
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 => ... });
}
DESCRIPTION