tapsoob 0.5.28 → 0.5.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tapsoob/operation.rb +10 -3
- 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: 748c9cf97135cae0c72f0ba298f7c3f197e65764ce4c44c0670d8ef2fe5181ed
|
|
4
|
+
data.tar.gz: 7bebc431915dcf8dd5bff0ee341cf22765646d1854485c23f80b5b9c642fc142
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 404478581e61ebdd2875c21d0af865acd5e9dba010292819046cd5e195c9c78cad675bdd50216ea26c5bba8923c0e532a8bd2593b4fe7eb0e71f85db865ef067
|
|
7
|
+
data.tar.gz: 3310489ebd6dcfd7efc76c4fd5d9b2ec6ffa9da12c6cb4161ffd02267f376927b957f5142dcf42ba81fd544c470c36e07f7e0263b66bcae6168b6c9dfe309b61
|
data/lib/tapsoob/operation.rb
CHANGED
|
@@ -436,7 +436,9 @@ module Tapsoob
|
|
|
436
436
|
log.info "#{tables.size} tables, #{format_number(record_count)} records"
|
|
437
437
|
|
|
438
438
|
tables.each do |table_name, count|
|
|
439
|
-
|
|
439
|
+
# Skip if data file doesn't exist or has no data
|
|
440
|
+
data_file = File.join(dump_path, "data", "#{table_name}.json")
|
|
441
|
+
next unless File.exist?(data_file) && count > 0
|
|
440
442
|
db[table_name.to_sym].truncate if @opts[:purge]
|
|
441
443
|
stream = Tapsoob::DataStream.factory(db, {
|
|
442
444
|
:table_name => table_name,
|
|
@@ -532,8 +534,13 @@ module Tapsoob
|
|
|
532
534
|
tbls = Dir.glob(File.join(dump_path, "schemas", "*")).map { |path| File.basename(path, ".rb") }
|
|
533
535
|
tbls.each do |table|
|
|
534
536
|
if File.exist?(File.join(dump_path, "data", "#{table}.json"))
|
|
535
|
-
|
|
536
|
-
|
|
537
|
+
# Read NDJSON format - each line is a separate JSON chunk
|
|
538
|
+
total_rows = 0
|
|
539
|
+
File.readlines(File.join(dump_path, "data", "#{table}.json")).each do |line|
|
|
540
|
+
chunk = JSON.parse(line.strip)
|
|
541
|
+
total_rows += chunk["data"].size if chunk["data"]
|
|
542
|
+
end
|
|
543
|
+
tables_with_counts[table] = total_rows
|
|
537
544
|
else
|
|
538
545
|
tables_with_counts[table] = 0
|
|
539
546
|
end
|
data/lib/tapsoob/version.rb
CHANGED