Repository navigation
mysql mssql postgresql 中sql语句不填默认读取所有表中的数据 - #480
Merged
Merged
Conversation
Collaborator
Author
wonderflow
reviewed
May 15, 2018
| cronSchedule, _ = conf.GetStringOr(KeyMysqlCron, "") | ||
| execOnStart, _ = conf.GetBoolOr(KeyMysqlExecOnStart, true) | ||
| encoder, _ = conf.GetStringOr(KeyEncoding, "") | ||
| log.Infof("encoder: %v", encoder) |
redHJ
force-pushed
the
pdr-6049
branch
3 times, most recently
from
May 18, 2018 13:28
a6dc352 to
603c056
Compare
wonderflow
reviewed
May 18, 2018
| return errors.New("SqlReader not support readmode") | ||
| } | ||
|
|
||
| func getHost(datasource, split string) (host string) { |
Contributor
There was a problem hiding this comment.
这个函数纯粹通过split拿到的host不一定是对的,还是不要拿host了,直接通过Database和table记录吧
wonderflow
reviewed
May 18, 2018
| } | ||
|
|
||
| // WriteDoneFile 将当前文件写入donefiel中 | ||
| func (m *Meta) WriteDoneFile(currFile string) (err error) { |
Contributor
There was a problem hiding this comment.
原来有一个appendDoneFile了,现在这个是不是重复了?
Contributor
There was a problem hiding this comment.
如果你要再写一个新的,应该换个名字,比如 WriteSqlDoneFile
Contributor
There was a problem hiding this comment.
函数里面的参数也应该从curlFile改成 finishedTables
| } | ||
|
|
||
| // 读取当前读取的文件和offset | ||
| func (m *Meta) ReadDoneFile() (currFile string, err error) { |
Contributor
There was a problem hiding this comment.
如果你要再写一个新的,应该换个名字,比如 ReadSqlDoneFile
| cronSchedule, _ = conf.GetStringOr(KeyMysqlCron, "") | ||
| execOnStart, _ = conf.GetBoolOr(KeyMysqlExecOnStart, true) | ||
| encoder, _ = conf.GetStringOr(KeyEncoding, "") | ||
| dataSourceArr := strings.Split(dataSource, "(") |
Contributor
There was a problem hiding this comment.
DataSource这个信息可以不要,感觉这么拿不稳,或者你用各个Database的driver库里面的解析函数去拿,这样写容易出bug,尤其是下面的split
wonderflow
reviewed
May 18, 2018
| mr.offsets = make([]int64, len(mr.syncSQLs)) | ||
| } | ||
|
|
||
| tableDone, omitMeta := restoreTableDone(mr.meta, tables) |
Contributor
There was a problem hiding this comment.
这个 restoreTableDone 只有在exec里面才需要吗,一开始NewSqlReader的时候是不是要
redHJ
force-pushed
the
pdr-6049
branch
2 times, most recently
from
May 18, 2018 17:23
6b8740f to
f2e81dc
Compare
Contributor
|
剩下的问题我来改一下 |
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.
No description provided.