feat: dryrun migration should only print not-select sqls
This commit is contained in:
parent
9514d5f9e6
commit
9b714d07f5
@ -47,7 +47,9 @@ type printSQLLogger struct {
|
|||||||
|
|
||||||
func (l *printSQLLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
|
func (l *printSQLLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
|
||||||
sql, _ := fc()
|
sql, _ := fc()
|
||||||
|
if len(sql) < 6 || strings.ToUpper(sql[0:6]) != "SELECT" {
|
||||||
fmt.Println(sql + ";")
|
fmt.Println(sql + ";")
|
||||||
|
}
|
||||||
l.Interface.Trace(ctx, begin, fc, err)
|
l.Interface.Trace(ctx, begin, fc, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user