@@ -78,14 +78,14 @@ type DumpJob struct {
78
78
79
79
// DumpOptions defines a logical dump options.
80
80
type DumpOptions struct {
81
- DumpLocation string `yaml:"dumpLocation"`
82
- DockerImage string `yaml:"dockerImage"`
83
- ContainerConfig map [string ]interface {} `yaml:"containerConfig"`
84
- Connection Connection `yaml:"connection"`
85
- Source Source `yaml:"source"`
86
- Databases map [string ]DBDefinition `yaml:"databases"`
87
- ParallelJobs int `yaml:"parallelJobs"`
88
- Restore ImmediateRestore `yaml:"immediateRestore"`
81
+ DumpLocation string `yaml:"dumpLocation"`
82
+ DockerImage string `yaml:"dockerImage"`
83
+ ContainerConfig map [string ]interface {} `yaml:"containerConfig"`
84
+ Connection Connection `yaml:"connection"`
85
+ Source Source `yaml:"source"`
86
+ Databases map [string ]DumpDefinition `yaml:"databases"`
87
+ ParallelJobs int `yaml:"parallelJobs"`
88
+ Restore ImmediateRestore `yaml:"immediateRestore"`
89
89
}
90
90
91
91
// Source describes source of data to dump.
@@ -95,11 +95,12 @@ type Source struct {
95
95
RDS * RDSConfig `yaml:"rdsIam"`
96
96
}
97
97
98
- // DBDefinition describes a database for dumping.
99
- type DBDefinition struct {
100
- Tables []string `yaml:"tables"`
101
- Format string `yaml:"format"`
102
- dbName string
98
+ // DumpDefinition describes a database for dumping.
99
+ type DumpDefinition struct {
100
+ Tables []string `yaml:"tables"`
101
+ Format string `yaml:"format"`
102
+ Compression compressionType `yaml:"compression"`
103
+ dbName string
103
104
}
104
105
105
106
type dumpJobConfig struct {
@@ -366,8 +367,8 @@ func (d *DumpJob) Run(ctx context.Context) (err error) {
366
367
return nil
367
368
}
368
369
369
- func (d * DumpJob ) getDBList (ctx context.Context ) (map [string ]DBDefinition , error ) {
370
- dbList := make (map [string ]DBDefinition )
370
+ func (d * DumpJob ) getDBList (ctx context.Context ) (map [string ]DumpDefinition , error ) {
371
+ dbList := make (map [string ]DumpDefinition )
371
372
372
373
connStr := db .ConnectionString (d .config .db .Host , strconv .Itoa (d .config .db .Port ), d .config .db .Username , d .config .db .DBName , d .getPassword ())
373
374
@@ -387,7 +388,7 @@ func (d *DumpJob) getDBList(ctx context.Context) (map[string]DBDefinition, error
387
388
return nil , errors .Wrap (err , "failed to scan next row in database list result set" )
388
389
}
389
390
390
- dbList [dbName ] = DBDefinition {}
391
+ dbList [dbName ] = DumpDefinition {}
391
392
}
392
393
393
394
return dbList , nil
@@ -420,12 +421,12 @@ func (d *DumpJob) cleanupDumpLocation(ctx context.Context, dumpContID string) er
420
421
return nil
421
422
}
422
423
423
- func (d * DumpJob ) dumpDatabase (ctx context.Context , dumpContID , dbName string , dbDefinition DBDefinition ) error {
424
- dumpCommand := d .buildLogicalDumpCommand (dbName , dbDefinition .Tables )
424
+ func (d * DumpJob ) dumpDatabase (ctx context.Context , dumpContID , dbName string , dumpDefinition DumpDefinition ) error {
425
+ dumpCommand := d .buildLogicalDumpCommand (dbName , dumpDefinition .Tables )
425
426
log .Msg ("Running dump command: " , dumpCommand )
426
427
427
- if len (dbDefinition .Tables ) > 0 {
428
- log .Msg ("Partial dump will be run. Tables for dumping: " , strings .Join (dbDefinition .Tables , ", " ))
428
+ if len (dumpDefinition .Tables ) > 0 {
429
+ log .Msg ("Partial dump will be run. Tables for dumping: " , strings .Join (dumpDefinition .Tables , ", " ))
429
430
}
430
431
431
432
if output , err := d .performDumpCommand (ctx , dumpContID , types.ExecConfig {
0 commit comments