tapsoob 0.3.19 → 0.3.20

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: f4448c494a38e070763f1ba415d875895871a155f502299a50f3b121ba13aa27
4
- data.tar.gz: f43a3b25ce1913049f1ab8bdb5246e4bd16ee565fd54e8897aaecfe9157f0dd5
3
+ metadata.gz: 52d4bfd61d315b90beb05943e4ed8d450ea6fef3f3d8cf8e685a36aace4a67d8
4
+ data.tar.gz: 73a623f81cfd0b8b5238ecfa06e0933d0033128ea7bd573f29f801294049ed46
5
5
  SHA512:
6
- metadata.gz: '0882cc725e9b0212877027e2bebf9c8e0ae6542eaa5e786a56541c80177fb6ba9c9f1c1aa4e8fa53e861a5708a73dd616debda95346031c3f36289404c00a4e5'
7
- data.tar.gz: 03c3aa4c4f323b6465ffa5172563a6370466451d610966e1ce52dd25296cee3aa927b334c08a4d83701cedfd1730fe3822c95aa405a57523cca7ae2c4a3e39ec
6
+ metadata.gz: df06895063ad4caf4fd7270a27771dc82f52d2b2d7e035c2a7a5651c2e6dc336e11741285e8a86a12b4af205391e472029c3941cc96412c7f7dbacd3ba6fca07
7
+ data.tar.gz: 4ae7a6b34fce4d1f267f8fd95c2cf895608232d9dd687427c3e9ed33a7a35402f33c5db87a7bd9a6cb924cf8c961973fe73303a30d2d3b0f282c84127850c859
@@ -38,6 +38,7 @@ module Tapsoob
38
38
  option :filter, desc: "Regex Filter for tables", type: :string, aliases: "-f"
39
39
  option :tables, desc: "Shortcut to filter on a list of tables", type: :array, aliases: "-t"
40
40
  option :"exclude-tables", desc: "Shortcut to exclude a list of tables", type: :array, aliases: "-e"
41
+ option :purge, desc: "Purge data in tables prior to performing the import", default: false, type: :boolean, aliases: "-p"
41
42
  option :debug, desc: "Enable debug messages", default: false, type: :boolean, aliases: "-d"
42
43
  def push(dump_path, database_url)
43
44
  opts = parse_opts(options)
@@ -70,6 +71,9 @@ module Tapsoob
70
71
  debug: options[:debug]
71
72
  }
72
73
 
74
+ # Purge (push only)
75
+ opts[:purge] = options[:purge] if options.key?(:purge)
76
+
73
77
  # Resume
74
78
  if options[:resume]
75
79
  if File.exists?(options[:resume])
@@ -393,6 +393,7 @@ module Tapsoob
393
393
 
394
394
  tables.each do |table_name, count|
395
395
  next unless File.exists?(File.join(dump_path, "data", "#{table_name}.json"))
396
+ db[table_name.to_sym].truncate if @opts[:purge]
396
397
  stream = Tapsoob::DataStream.factory(db,
397
398
  :table_name => table_name,
398
399
  :chunksize => default_chunksize)
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.3.19".freeze
3
+ VERSION = "0.3.20".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.3.19
4
+ version: 0.3.20
5
5
  platform: ruby
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: 2020-10-02 00:00:00.000000000 Z
12
+ date: 2021-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ripl
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.1.4
152
+ rubygems_version: 3.1.6
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Simple tool to import/export databases.