tapsoob 0.4.19-java → 0.4.23-java

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: a478b81adfae4bae3508db6802b7b9a7280f8579e4da19cd1d575d741dacd0f3
4
- data.tar.gz: 2b29446e1aa6ce40c4aabacbfd2d2e227b75d11f7426706de97948489ee2d87d
3
+ metadata.gz: e8d6fce8a1a4f85f3400a93624b455db3a640a68b5f03b1b87ffe0d17b2ddd82
4
+ data.tar.gz: 77d96d95817b4267c68329a6cec5f55c8810265572c117c6088762edbec97db8
5
5
  SHA512:
6
- metadata.gz: e4c76f4fb86ef9b0358e24657ea12911dacdd118a484210a97b206ba6b486c7afa1126d0d2fb7f52dc40bca96da9d29317dea687581ff953f4c92d0ca3f43878
7
- data.tar.gz: fcfe1fc46dce2b88616557c419c04e451307a0c86e295663a750564efb6de1bf67c1f108d1ea86e9294d6a133abc258995562df657c038a127a3f4b2f9e160b4
6
+ metadata.gz: 29a06e8d1f6232f923c5d5eb7c27ecb874a66c14d3e7bf742518c71d568b90ac59794cf8f0478812421ea7f7a1994f05826457026ad3194261411eda19c7c41c
7
+ data.tar.gz: 917d3ffdde7941513eae57de66dcd9793b3bd9ca67889bfb84c1897484067d4ceb6c126adbbbe7af343f906cbb67ff13f7496e386a3cecf9fd25ede151f19228
@@ -393,7 +393,7 @@ module Tapsoob
393
393
  log.info "#{tables.size} tables, #{format_number(record_count)} records"
394
394
 
395
395
  tables.each do |table_name, count|
396
- next unless File.exists?(File.join(dump_path, "data", "#{table_name}.json"))
396
+ next unless File.exists?(File.join(dump_path, "data", "#{table_name}.json")) || File.exists?(File.join(dump_path, "data", "#{table_name}.json")) && JSON.parse(File.read(File.join(dump_path, "data", "#{table_name}.json")))["data"].size == 0
397
397
  db[table_name.to_sym].truncate if @opts[:purge]
398
398
  stream = Tapsoob::DataStream.factory(db, {
399
399
  :table_name => table_name,
@@ -485,7 +485,7 @@ module Tapsoob
485
485
 
486
486
  def fetch_local_tables_info
487
487
  tables_with_counts = {}
488
- tbls = Dir.glob(File.join(dump_path, "data", "*")).map { |path| File.basename(path, ".json") }
488
+ tbls = Dir.glob(File.join(dump_path, "schemas", "*")).map { |path| File.basename(path, ".rb") }
489
489
  tbls.each do |table|
490
490
  if File.exists?(File.join(dump_path, "data", "#{table}.json"))
491
491
  data = JSON.parse(File.read(File.join(dump_path, "data", "#{table}.json")))
data/lib/tapsoob/utils.rb CHANGED
@@ -75,6 +75,7 @@ Data : #{data}
75
75
  res = { table_name: table, header: header, data: only_data }
76
76
 
77
77
  # Add types if schema isn't empty
78
+ db.extension :schema_dumper # Add schema dumper extension in case it hasn't been added until now
78
79
  res[:types] = schema.map do |c|
79
80
  case db.column_schema_to_ruby_type(c.last)[:type]
80
81
  when BigDecimal
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.4.19".freeze
3
+ VERSION = "0.4.23".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.4.19
4
+ version: 0.4.23
5
5
  platform: java
6
6
  authors:
7
7
  - Félix Bellanger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-19 00:00:00.000000000 Z
12
+ date: 2021-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement