3535 ifExists bool
3636 clean bool
3737 noOwner bool
38+ tables []string
3839 excludeTable []string
3940 excludeTableData []string
4041)
@@ -50,6 +51,7 @@ func init() {
5051 Command .Flags ().BoolVar (& ifExists , "if-exists" , true , "use IF EXISTS when dropping objects" )
5152 Command .Flags ().BoolVarP (& clean , "clean" , "c" , true , "clean (drop) database objects before recreating" )
5253 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" )
5355 Command .Flags ().StringSliceVarP (& excludeTable , "exclude-table" , "T" , []string {}, "do NOT dump the specified table(s)" )
5456 Command .Flags ().StringSliceVar (& excludeTableData , "exclude-table-data" , []string {}, "do NOT dump data for the specified table(s)" )
5557}
@@ -178,11 +180,14 @@ func buildCommand() []string {
178180 if ifExists {
179181 cmd = append (cmd , "--if-exists" )
180182 }
183+ for _ , table := range tables {
184+ cmd = append (cmd , "--table=" + table )
185+ }
181186 for _ , table := range excludeTable {
182- cmd = append (cmd , "--exclude-table=" + table )
187+ cmd = append (cmd , "--exclude-table=" + table )
183188 }
184189 for _ , table := range excludeTableData {
185- cmd = append (cmd , "--exclude-table-data=" + table )
190+ cmd = append (cmd , "--exclude-table-data=" + table )
186191 }
187192 if outputFormat == sqlformat .Custom {
188193 cmd = append (cmd , "--format=c" )
0 commit comments