tapsoob 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10ae20ca73c6821c188d7345388336477aa6517e8761d2caefccf1b0df073556
4
- data.tar.gz: f36c26256ff6531439a4c1e0f1e93694128157a17b4e9a4d92c98fc45e3e03d0
3
+ metadata.gz: af1c77e65193e1c885e35d4e0b7e2c28b933f915b9b2ad0d21398fe5fa7abd8c
4
+ data.tar.gz: 0a286d60df2babfe2282a708fb802d561afa9960ca7e8287030c1e9d9df3500e
5
5
  SHA512:
6
- metadata.gz: 4d052875c6dc6d045c673b2e8d6505be0823d8a9ec45ed2c47c8ab8cfe9a9b17007cef94db6a05bece6a95900eae992888be12585e906bef8f40eede6bc96848
7
- data.tar.gz: 3e3b6d5c73ae96dc28c44777207c6f7a70379e6c9efbbfa6ab241b2324a3f759d1c970e91cb868f06659945498dafbbb4e4f62f14b02cc3a623b0d3a23d7446f
6
+ metadata.gz: 4fad86e7e1ec643b8d3f3a86ea06a69f2b5878cf20ae0c866f48bbbceae5af09f8d1da55533d875045b6e75470e3bf73be82512db90ef86be931616207c86a30
7
+ data.tar.gz: e4740da5ddbdbe77248707db361cb825afb9130a6db63a6dd212cad06fc0a266a11f6424503ecec6c676ba41d62f68c9c108a38c8b43109890da15f9512f83ed
@@ -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, aliases: "-p"
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"
@@ -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 :"schema-only", desc: "Don't transfer the data just schema", default: false, type: :boolean
14
- option :"skip-schema", desc: "Don't transfer the schema just data", default: false, type: :boolean, aliases: "-s"
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, aliases: "-d"
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 :"schema-only", desc: "Don't transfer the data just schema", default: false, type: :boolean
35
- option :"skip-schema", desc: "Don't transfer the schema just data", default: false, type: :boolean, aliases: "-s"
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, aliases: "-d"
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
- schema_only: options[:"schema-only"],
73
- skip_schema: options[:"skip-schema"],
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],
@@ -21,12 +21,12 @@ module Tapsoob
21
21
  "op"
22
22
  end
23
23
 
24
- def schema_only?
25
- !!opts[:schema_only]
24
+ def data?
25
+ opts[:data]
26
26
  end
27
27
 
28
- def skip_schema?
29
- !!opts[:skip_schema]
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 !skip_schema?
170
- pull_indexes if indexes_first? && !skip_schema?
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 unless schema_only?
175
- pull_indexes if !indexes_first? && !skip_schema?
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 !skip_schema?
363
- push_indexes if indexes_first? && !skip_schema?
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 unless schema_only?
368
- push_indexes if !indexes_first? && !skip_schema?
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
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.5.2".freeze
3
+ VERSION = "0.5.3".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapsoob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Félix Bellanger