Skip to content

Commit f72d939

Browse files
committed
chore: remove useless code
1 parent f662de6 commit f72d939

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

pkg/cmd/schema_generator/schema_generator.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -286,56 +286,6 @@ func (schema_generator *SchemaGenerator) doExecSQLConcurrently(sqls []string, jo
286286
log.Println("All SQL execution tasks completed.")
287287
}
288288

289-
// func (schema_generator *SchemaGenerator) doExecSQL(sqlFile string) {
290-
// if !schema_generator.execSQL {
291-
// log.Printf("Skipping execution of SQL file: %s\n", sqlFile)
292-
// return
293-
// }
294-
// log.Printf("Executing SQL file: %s\n", sqlFile)
295-
// // Open the SQL file
296-
// file, err := os.Open(sqlFile)
297-
// if err != nil {
298-
// log.Printf("Error opening SQL file: %v\n", err)
299-
// return
300-
// }
301-
// defer file.Close()
302-
303-
// // Create a command to execute the SQL file
304-
// cmd := exec.Command("mysql", "-h", schema_generator.mysqlHost, "-P", schema_generator.mysqlPort)
305-
306-
// cmd.Stdin = file
307-
308-
// // Start the command
309-
// stdout, err := cmd.StdoutPipe()
310-
// if err != nil {
311-
// log.Printf("Error creating stdout pipe: %v\n", err)
312-
// return
313-
// }
314-
// stderr, err := cmd.StderrPipe()
315-
// if err != nil {
316-
// log.Printf("Error creating stderr pipe: %v\n", err)
317-
// return
318-
// }
319-
320-
// if err := cmd.Start(); err != nil {
321-
// log.Printf("Error starting command: %v\n", err)
322-
// return
323-
// }
324-
325-
// // Write the SQL file content to the command's stdin
326-
327-
// // Read the command's stdout and stderr
328-
// stdoutBytes, _ := io.ReadAll(stdout)
329-
// stderrBytes, _ := io.ReadAll(stderr)
330-
331-
// // Wait for the command to finish
332-
// if err := cmd.Wait(); err != nil {
333-
// log.Printf("Error executing SQL: %s\n", string(stderrBytes))
334-
// } else {
335-
// fmt.Println(string(stdoutBytes))
336-
// }
337-
// }
338-
339289
func NewCommand() *cobra.Command {
340290
var rootCmd = &cobra.Command{
341291
Use: "schema_generator",

0 commit comments

Comments
 (0)