tapsoob 0.5.2-java → 0.5.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapsoob/cli/data_stream.rb +1 -1
- data/lib/tapsoob/cli/root.rb +8 -8
- data/lib/tapsoob/operation.rb +14 -14
- data/lib/tapsoob/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c2fd6bc0ee522b1688f7e5545ff53d675a4d8f33fdccda8c9e881792f1ff0c4
|
4
|
+
data.tar.gz: 8cd9ca207b7b415da7405bcf01c2031e0b789e428493fdc649b78a39c3007480
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6427c733ba4f6ed9390edbbaabbcc80b9ed2dae52ed2bc8cf390f1654527d3f63828f6a75c396250d3846ec8667c407b6139d3dcf94e6befafeea93d382442e
|
7
|
+
data.tar.gz: 880938fb5dedfc48671f01cad691d44a72f8c1aa4fd023b15fecba8a69dc4602f852e1f19403b6b0538e3a1d127c521bd71e89ea43ef75099697c6b21bf4f83c
|
@@ -26,7 +26,7 @@ module Tapsoob
|
|
26
26
|
option :tables, desc: "Shortcut to filter on a list of tables", type: :array, aliases: "-t"
|
27
27
|
option :"exclude-tables", desc: "Shortcut to exclude a list of tables", type: :array, aliases: "-e"
|
28
28
|
option :progress, desc: "Show progress", default: true, type: :boolean, aliases: "-p"
|
29
|
-
option :purge, desc: "Purge data in tables prior to performing the import", default: false, type: :boolean
|
29
|
+
option :purge, desc: "Purge data in tables prior to performing the import", default: false, type: :boolean
|
30
30
|
option :"skip-duplicates", desc: "Remove duplicates when loading data", default: false, type: :boolean
|
31
31
|
option :"discard-identity", desc: "Remove identity when pushing data (may result in creating duplicates)", default: false, type: :boolean
|
32
32
|
option :debug, desc: "Enable debug messages", default: false, type: :boolean, aliases: "-d"
|
data/lib/tapsoob/cli/root.rb
CHANGED
@@ -10,8 +10,8 @@ module Tapsoob
|
|
10
10
|
module CLI
|
11
11
|
class Root < Thor
|
12
12
|
desc "pull DUMP_PATH DATABASE_URL", "Pull a dump from a database to a folder"
|
13
|
-
option :
|
14
|
-
option :
|
13
|
+
option :data, desc: "Pull the data to the database", default: true, type: :boolean, aliases: '-d'
|
14
|
+
option :schema, desc: "Pull the schema to the database", default: true, type: :boolean, aliases: "-s"
|
15
15
|
option :"indexes-first", desc: "Transfer indexes first before data", default: false, type: :boolean, aliases: "-i"
|
16
16
|
option :resume, desc: "Resume a Tapsoob Session from a stored file", type: :string, aliases: "-r"
|
17
17
|
option :chunksize, desc: "Initial chunksize", default: 1000, type: :numeric, aliases: "-c"
|
@@ -19,7 +19,7 @@ module Tapsoob
|
|
19
19
|
option :tables, desc: "Shortcut to filter on a list of tables", type: :array, aliases: "-t"
|
20
20
|
option :"exclude-tables", desc: "Shortcut to exclude a list of tables", type: :array, aliases: "-e"
|
21
21
|
option :progress, desc: "Show progress", default: true, type: :boolean
|
22
|
-
option :debug, desc: "Enable debug messages", default: false, type: :boolean
|
22
|
+
option :debug, desc: "Enable debug messages", default: false, type: :boolean
|
23
23
|
def pull(dump_path, database_url)
|
24
24
|
opts = parse_opts(options)
|
25
25
|
Tapsoob.log.level = Logger::DEBUG if opts[:debug]
|
@@ -31,8 +31,8 @@ module Tapsoob
|
|
31
31
|
end
|
32
32
|
|
33
33
|
desc "push DUMP_PATH DATABASE_URL", "Push a previously tapsoob dump to a database"
|
34
|
-
option :
|
35
|
-
option :
|
34
|
+
option :data, desc: "Push the data to the database", default: true, type: :boolean, aliases: '-d'
|
35
|
+
option :schema, desc: "Push the schema to the database", default: true, type: :boolean, aliases: "-s"
|
36
36
|
option :"indexes-first", desc: "Transfer indexes first before data", default: false, type: :boolean, aliases: "-i"
|
37
37
|
option :resume, desc: "Resume a Tapsoob Session from a stored file", type: :string, aliases: "-r"
|
38
38
|
option :chunksize, desc: "Initial chunksize", default: 1000, type: :numeric, aliases: "-c"
|
@@ -43,7 +43,7 @@ module Tapsoob
|
|
43
43
|
option :"skip-duplicates", desc: "Remove duplicates when loading data", default: false, type: :boolean
|
44
44
|
option :"discard-identity", desc: "Remove identity when pushing data (may result in creating duplicates)", default: false, type: :boolean
|
45
45
|
option :progress, desc: "Show progress", default: true, type: :boolean
|
46
|
-
option :debug, desc: "Enable debug messages", default: false, type: :boolean
|
46
|
+
option :debug, desc: "Enable debug messages", default: false, type: :boolean
|
47
47
|
def push(dump_path, database_url)
|
48
48
|
opts = parse_opts(options)
|
49
49
|
Tapsoob.log.level = Logger::DEBUG if opts[:debug]
|
@@ -69,8 +69,8 @@ module Tapsoob
|
|
69
69
|
def parse_opts(options)
|
70
70
|
# Default options
|
71
71
|
opts = {
|
72
|
-
|
73
|
-
|
72
|
+
data: options[:data],
|
73
|
+
data: options[:schema],
|
74
74
|
indexes_first: options[:"indexes_first"],
|
75
75
|
disable_compression: options[:"disable-compression"],
|
76
76
|
tables: options[:tables],
|
data/lib/tapsoob/operation.rb
CHANGED
@@ -21,12 +21,12 @@ module Tapsoob
|
|
21
21
|
"op"
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
|
24
|
+
def data?
|
25
|
+
opts[:data]
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
28
|
+
def schema?
|
29
|
+
opts[:schema]
|
30
30
|
end
|
31
31
|
|
32
32
|
def indexes_first?
|
@@ -166,13 +166,13 @@ module Tapsoob
|
|
166
166
|
def run
|
167
167
|
catch_errors do
|
168
168
|
unless resuming?
|
169
|
-
pull_schema if
|
170
|
-
pull_indexes if indexes_first? &&
|
169
|
+
pull_schema if schema?
|
170
|
+
pull_indexes if indexes_first? && schema?
|
171
171
|
end
|
172
172
|
setup_signal_trap
|
173
|
-
pull_partial_data if resuming?
|
174
|
-
pull_data
|
175
|
-
pull_indexes if !indexes_first? &&
|
173
|
+
pull_partial_data if data? && resuming?
|
174
|
+
pull_data if data?
|
175
|
+
pull_indexes if !indexes_first? && schema?
|
176
176
|
pull_reset_sequences
|
177
177
|
end
|
178
178
|
end
|
@@ -359,13 +359,13 @@ module Tapsoob
|
|
359
359
|
def run
|
360
360
|
catch_errors do
|
361
361
|
unless resuming?
|
362
|
-
push_schema if
|
363
|
-
push_indexes if indexes_first? &&
|
362
|
+
push_schema if schema?
|
363
|
+
push_indexes if indexes_first? && schema?
|
364
364
|
end
|
365
365
|
setup_signal_trap
|
366
|
-
push_partial_data if resuming?
|
367
|
-
push_data
|
368
|
-
push_indexes if !indexes_first? &&
|
366
|
+
push_partial_data if data? && resuming?
|
367
|
+
push_data if data?
|
368
|
+
push_indexes if !indexes_first? && schema?
|
369
369
|
push_reset_sequences
|
370
370
|
end
|
371
371
|
end
|
data/lib/tapsoob/version.rb
CHANGED