tapsoob 0.5.16 → 0.5.18

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: 66271a176a7b7e49544f442d282f9aa0255903df7c75e1df56b82740fbbb1d57
4
- data.tar.gz: b0eba2d735a451ec0dc1b9c577c5f34b4ccd73ad5b7db0cf045c88adb1c4bee5
3
+ metadata.gz: c0f71cf6e47b30712874de0eecfaf12fe3a6dcd14010e5e9d7dbb04cfb408546
4
+ data.tar.gz: c6d6eaaab5c80b0aadb0a3d88a16178441fd8178141c3c401ca8b8234c1baaa1
5
5
  SHA512:
6
- metadata.gz: 9c3abc9e6bd11b2aaba84e5a37e78ddf46fe5489122b841d343e4cfb616d12c77b858bbeb6c49b315ad8ecd2b82da0a55986f977676077ac4021f084b9d738b7
7
- data.tar.gz: 4168718e2834870c6e83e925fd9f33aecaaceae957e87dce05a0ad4f351b62697829d33c6c07bf47559c0ef7f34873a2355265e0e293d1cc49b685f20b416075
6
+ metadata.gz: fda756acc28dfef8a57e609e6f3cfafd9a6b684fba68c3e0e748319455459e4d983768b523c1b44e11c4ee1b8e1f0244e7c7254f27dc1c17a34392ec96daf68f
7
+ data.tar.gz: e279e2c384c96603f7245599fe1db4528a59221349f57bc26cd9ad2297f3429a8aeca401f70de24d31183813cd30fe5a744f696a1607cec01bfe835750405986
@@ -54,6 +54,7 @@ module Tapsoob
54
54
  stream.import_rows(table)
55
55
  rescue Exception => e
56
56
  stream.log.debug e.message
57
+ STDERR.puts "Error loading data in #{table[:table_name]} : #{e.message}"
57
58
  end
58
59
  end
59
60
  end
@@ -18,6 +18,7 @@ module Tapsoob
18
18
  option :"disable-compression", desc: "Disable Compression", default: false, type: :boolean, aliases: "-g"
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
+ option :"indexes", type: :boolean, default: false
21
22
  option :"same-db", type: :boolean, default: false
22
23
  option :progress, desc: "Show progress", default: true, type: :boolean
23
24
  option :debug, desc: "Enable debug messages", default: false, type: :boolean
@@ -80,6 +81,7 @@ module Tapsoob
80
81
  }
81
82
 
82
83
  # Pull only options
84
+ opts[:indexes] = options[:"indexes"] if options.key?(:"indexes")
83
85
  opts[:same_db] = options[:"same-db"] if options.key?(:"same-db")
84
86
 
85
87
  # Push only options
@@ -183,7 +183,7 @@ module Tapsoob
183
183
 
184
184
  progress = ProgressBar.new('Schema', tables.size)
185
185
  tables.each do |table_name, count|
186
- schema_data = Tapsoob::Schema.dump_table(database_url, table_name)
186
+ schema_data = Tapsoob::Schema.dump_table(database_url, table_name, @opts.slice(:indexes, :same_db))
187
187
  log.debug "Table: #{table_name}\n#{schema_data}\n"
188
188
  output = Tapsoob::Utils.export_schema(dump_path, table_name, schema_data)
189
189
  puts output if dump_path.nil? && output
@@ -31,14 +31,14 @@ END_MIG
31
31
  template.result(binding)
32
32
  end
33
33
 
34
- def dump_table(database_url, table)
34
+ def dump_table(database_url, table, options)
35
35
  table = table.to_sym
36
36
  Sequel.connect(database_url) do |db|
37
37
  db.extension :schema_dumper
38
38
  <<END_MIG
39
39
  Class.new(Sequel::Migration) do
40
40
  def up
41
- #{db.dump_table_schema(table, indexes: false)}
41
+ #{db.dump_table_schema(table, options)}
42
42
  end
43
43
 
44
44
  def down
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.5.16".freeze
3
+ VERSION = "0.5.18".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.16
4
+ version: 0.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Félix Bellanger