xelabs / go-mydumper

A multi-threaded MySQL backup and restore tool, faster than mysqldump
GNU General Public License v3.0
346 stars 100 forks source link

Allow regex to specify databases to dump #29

Closed fdellwing closed 4 years ago

fdellwing commented 4 years ago

Closes #26

codecov[bot] commented 4 years ago

Codecov Report

Merging #29 into master will increase coverage by 1.61%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   92.39%   94.00%   +1.61%     
==========================================
  Files           4        4              
  Lines         355      367      +12     
==========================================
+ Hits          328      345      +17     
+ Misses         15       11       -4     
+ Partials       12       11       -1     
Impacted Files Coverage Δ
src/common/common.go 86.36% <ø> (ø)
src/common/dumper.go 95.06% <100.00%> (+0.39%) :arrow_up:
src/common/loader.go 96.61% <0.00%> (+4.23%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 01e1b4d...13483fd. Read the comment docs.

BohuTANG commented 4 years ago

Maybe It's better to add a new 'regex' parameter for the purpose.

On Tue, Mar 17, 2020 at 22:08 Fabian Dellwing notifications@github.com wrote:

@fdellwing commented on this pull request.

In conf/mydumper.ini.sample https://github.com/xelabs/go-mydumper/pull/29#discussion_r393705012:

@@ -8,7 +8,10 @@ user = root

User password

password = pwd

Database to dump

-database = xx +database = ^(mysql|sys|information_schema|performance_schema)$ +# If valid regex is provided whether or not to invert the match +# This option should be replaced as soon as a GPL-3.0 compliant go-pcre lib is found +database_invert_match = on

I do not quite understand. We of course use golangs regex, because it's the only thing available with GPLv3.

What might be a good idea is to split up the config sample in an simple config (remove anything optional and no regex) and an advanced config (with all the optional options and regex).

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/xelabs/go-mydumper/pull/29#discussion_r393705012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKBLFL4NLP3LLX2ENWOBTRH574BANCNFSM4LNJE7RQ .

-- BohuTANG

"The great artist is the simplifier."--- Vincent Van Gogh

fdellwing commented 4 years ago

How do you like this version?

BohuTANG commented 4 years ago

Thanks for the contribution. LGTM