2024-05-09 21:29:34 +08:00
|
|
|
package dto
|
|
|
|
|
|
|
|
|
|
import (
|
2024-10-21 22:27:42 +08:00
|
|
|
"io"
|
2024-10-20 03:52:23 +00:00
|
|
|
"mayfly-go/internal/db/dbm/dbi"
|
2024-05-09 21:29:34 +08:00
|
|
|
"mayfly-go/internal/db/domain/entity"
|
|
|
|
|
tagentity "mayfly-go/internal/tag/domain/entity"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type SaveDbInstance struct {
|
|
|
|
|
DbInstance *entity.DbInstance
|
|
|
|
|
AuthCerts []*tagentity.ResourceAuthCert
|
|
|
|
|
TagCodePaths []string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DumpDb struct {
|
|
|
|
|
DbId uint64
|
|
|
|
|
DbName string
|
|
|
|
|
Tables []string
|
|
|
|
|
DumpDDL bool // 是否dump ddl
|
|
|
|
|
DumpData bool // 是否dump data
|
|
|
|
|
|
2024-10-20 03:52:23 +00:00
|
|
|
LogId uint64
|
|
|
|
|
|
2024-10-21 22:27:42 +08:00
|
|
|
Writer io.WriteCloser
|
2024-10-20 03:52:23 +00:00
|
|
|
TargetDbType dbi.DbType
|
2024-12-08 13:04:23 +08:00
|
|
|
|
|
|
|
|
Log func(msg string)
|
|
|
|
|
Progress func(currentTable string, stmtType dbi.StmtType, stmtCount int, currentStmtTypeEnd bool) // dump进度
|
2024-10-20 03:52:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DefaultDumpLog(msg string) {
|
|
|
|
|
|
2024-05-09 21:29:34 +08:00
|
|
|
}
|
2024-12-08 13:04:23 +08:00
|
|
|
|
|
|
|
|
func DefaultDumpProgress(currentTable string, stmtType dbi.StmtType, stmtCount int, currentStmtTypeEnd bool) {
|
|
|
|
|
|
|
|
|
|
}
|