导出脚本支持批量插入,提高大表的导出速度,默认导出不使用use database 语句,以防止导入时选库其他库时,导入错误的库#12
Open
songdemei wants to merge 8 commits intojarvanstack:masterfrom
Open
导出脚本支持批量插入,提高大表的导出速度,默认导出不使用use database 语句,以防止导入时选库其他库时,导入错误的库#12songdemei wants to merge 8 commits intojarvanstack:masterfrom
songdemei wants to merge 8 commits intojarvanstack:masterfrom
Conversation
Owner
|
Owner
|
Owner
|
优化默认 use db, v0.7.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1、dump方法增加配置:
mysqldump.WithMultyInsert(1000)其中1000 为表记录最大一条SQL语句插入1000行数据,默认时一条数据一条insert,导入时,速度较慢。
2、默认去掉use db;语句,如果需要,在dump方法内增加:
mysqldump.WithUseDb()举例:导出A库的数据,然后我要用工具导入到测试库A1内,原来是实现不了的,现在导入时,工具先选择A1库,再执行脚本即可导入到A1库,
下个版本:
导出增加触发器支持
导出使用多协程,提高导出速度