Documentation ¶
Index ¶
- Constants
- Variables
- func All() map[OP]Exec
- func Cancel(op OP, cacheKey string) error
- func Export(ctx context.Context, noticer notice.Noticer, cfg *driver.DbAuth, ...) error
- func Import(ctx context.Context, noticer *notice.NoticeAndProgress, cfg *driver.DbAuth, ...) error
- func ResetAutoIncrement(sqlStructFile string) error
- type BGExec
- type Exec
- type FileInfo
- type FileInfos
- type OP
Constants ¶
View Source
const ( Importor = `mysql` Exportor = `mysqldump` )
Variables ¶
View Source
var Backgrounds = sync.Map{} //后台导入导出任务
Backgrounds 后台任务集合(包含SQL导入和导出任务)
View Source
var Charsets = []string{"armscii8", "ascii", "big5", "binary", "cp1250", "cp1251", "cp1256", "cp1257", "cp850", "cp852", "cp866", "cp932", "dec8", "eucjpms", "euckr", "gb18030", "gb2312", "gbk", "geostd8", "greek", "hebrew", "hp8", "keybcs2", "koi8r", "koi8u", "latin1", "latin2", "latin5", "latin7", "macce", "macroman", "sjis", "swe7", "tis620", "ucs2", "ujis", "utf16", "utf16le", "utf32", "utf8", "utf8mb4"}
Charsets MySQL 支持的字符集
View Source
var MySQLBinPaths = []string{`/usr/local/bin`, `/usr/bin`}
Functions ¶
func Export ¶
func Export(ctx context.Context, noticer notice.Noticer, cfg *driver.DbAuth, tables []string, structWriter, dataWriter interface{}, mysqlVersion string, hasGTID bool, resetAutoIncrements ...bool) error
Export 导出SQL文件
func Import ¶
func Import(ctx context.Context, noticer *notice.NoticeAndProgress, cfg *driver.DbAuth, cacheDir string, files []string) error
Import 导入SQL文件
func ResetAutoIncrement ¶
ResetAutoIncrement 重置AUTO_INCREMENT值为0
Types ¶
type BGExec ¶
type BGExec struct { Options echo.H Started time.Time Procs *FileInfos // contains filtered or unexported fields }
BGExec 后台执行信息
Click to show internal directories.
Click to hide internal directories.