35
35
ifExists bool
36
36
clean bool
37
37
noOwner bool
38
+ tables []string
38
39
excludeTable []string
39
40
excludeTableData []string
40
41
)
@@ -50,6 +51,7 @@ func init() {
50
51
Command .Flags ().BoolVar (& ifExists , "if-exists" , true , "use IF EXISTS when dropping objects" )
51
52
Command .Flags ().BoolVarP (& clean , "clean" , "c" , true , "clean (drop) database objects before recreating" )
52
53
Command .Flags ().BoolVarP (& noOwner , "no-owner" , "O" , true , "skip restoration of object ownership in plain-text format" )
54
+ Command .Flags ().StringSliceVarP (& tables , "table" , "t" , []string {}, "dump the specified table(s) only" )
53
55
Command .Flags ().StringSliceVarP (& excludeTable , "exclude-table" , "T" , []string {}, "do NOT dump the specified table(s)" )
54
56
Command .Flags ().StringSliceVar (& excludeTableData , "exclude-table-data" , []string {}, "do NOT dump data for the specified table(s)" )
55
57
}
@@ -178,11 +180,14 @@ func buildCommand() []string {
178
180
if ifExists {
179
181
cmd = append (cmd , "--if-exists" )
180
182
}
183
+ for _ , table := range tables {
184
+ cmd = append (cmd , "--table=" + table )
185
+ }
181
186
for _ , table := range excludeTable {
182
- cmd = append (cmd , "--exclude-table=" + table )
187
+ cmd = append (cmd , "--exclude-table=" + table )
183
188
}
184
189
for _ , table := range excludeTableData {
185
- cmd = append (cmd , "--exclude-table-data=" + table )
190
+ cmd = append (cmd , "--exclude-table-data=" + table )
186
191
}
187
192
if outputFormat == sqlformat .Custom {
188
193
cmd = append (cmd , "--format=c" )
0 commit comments