db_blaster 0.1.8 → 0.1.9

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: 548f2aefb696e0417a36de5169343570ca93d4d02fe04bdf13806f48be794d05
4
- data.tar.gz: ac6a6829cfaa8523b7151b585a4037b602faeb87d6166f021679ab863a8c986b
3
+ metadata.gz: 7e58f97f7c15cb1bb2d1bf1d4235e68e5d256adaf48f72481cb3c754f1d85aae
4
+ data.tar.gz: ffa443a609d6d2b10b7e7e3b65bdc45da8abfc8485b7f3fb46fa638ea1b0cd98
5
5
  SHA512:
6
- metadata.gz: fff1f7224220a29d7318f8d9dd793a72e3696db4f61c7829de45d4e90ab431863893ac41abbf7f779cdcc5eab9e8ef17ab4128115ad4e327d8441fdb737035e3
7
- data.tar.gz: c4bb757b9123e612ae42768a892b7a8cd2444f322ff3eb41d33b16ecd877fcdef9e33d3f7f6cd92fda72339207accb7f2ea2eb6d74f4d24a661cfe28c4c80343
6
+ metadata.gz: fd27fea13565a8f90a3d0b4db4fcac631453fc9579b35f5ad7e4061e7f4cc7bea01e12307efd5a865583f781cb793ceb50f6646708912edcef8742b5a3551f53
7
+ data.tar.gz: ca998517216be98f3c3d47d9e0f393aa230dd04a08cf54a0dfeb1fb734246f7e1d388c00b698b92eab7bded131addded3ffc413b9d029e1aa2f5ac3aadf78928
@@ -9,8 +9,7 @@ module DbBlaster
9
9
  queue_as 'default'
10
10
 
11
11
  def perform
12
- SourceTable.sync(SourceTableConfigurationBuilder
13
- .build_all(DbBlaster.configuration))
12
+ SyncSourceTablesWithConfiguration.sync
14
13
 
15
14
  DbBlaster::SourceTable.pluck(:id).each do |source_table_id|
16
15
  PublishSourceTableJob.perform_later(source_table_id, batch_start_time)
@@ -8,25 +8,21 @@ module DbBlaster
8
8
  end
9
9
 
10
10
  def build_schema
11
- ActiveRecord::Base.connection.tables.each_with_object({}) do |table_name, hash|
12
- unless AvailableTables::SYSTEM_TABLES.include?(table_name)
13
- hash[table_name] = build_columns_from_table_name(table_name)
14
- end
11
+ SyncSourceTablesWithConfiguration.sync
12
+
13
+ DbBlaster::SourceTable.all.each_with_object({}) do |source_table, hash|
14
+ hash[source_table.name] = build_columns_from_source_table(source_table)
15
15
  end
16
16
  end
17
17
 
18
- def build_columns_from_table_name(table_name)
19
- ActiveRecord::Base.connection.columns(table_name).collect do |column|
20
- next if ignored_column?(column.name)
18
+ def build_columns_from_source_table(source_table)
19
+ ActiveRecord::Base.connection.columns(source_table.name).collect do |column|
20
+ next if source_table.ignored_columns.include?(column.name)
21
21
 
22
22
  { name: column.name,
23
23
  type: column.type,
24
24
  limit: column.limit }
25
25
  end.compact
26
26
  end
27
-
28
- def ignored_column?(column)
29
- (DbBlaster.configuration.ignored_column_names || []).include?(column)
30
- end
31
27
  end
32
28
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DbBlaster
4
+ # Update the db-blaster source tables based on provided configuration
5
+ module SyncSourceTablesWithConfiguration
6
+ def self.sync
7
+ SourceTable.sync(SourceTableConfigurationBuilder
8
+ .build_all(DbBlaster.configuration))
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DbBlaster
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.9'
5
5
  end
data/lib/db_blaster.rb CHANGED
@@ -16,6 +16,7 @@ require 'db_blaster/chunker'
16
16
  require 'db_blaster/finder_sql'
17
17
  require 'db_blaster/finder'
18
18
  require 'db_blaster/source_tables_schema_builder'
19
+ require 'db_blaster/sync_source_tables_with_configuration'
19
20
 
20
21
  # Top-level module that serves as an entry point
21
22
  # into the engine gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_blaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perry Hertler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -149,6 +149,7 @@ files:
149
149
  - lib/db_blaster/source_table_configuration.rb
150
150
  - lib/db_blaster/source_table_configuration_builder.rb
151
151
  - lib/db_blaster/source_tables_schema_builder.rb
152
+ - lib/db_blaster/sync_source_tables_with_configuration.rb
152
153
  - lib/db_blaster/version.rb
153
154
  - lib/generators/db_blaster/install/install_generator.rb
154
155
  - lib/generators/db_blaster/install/templates/db_blaster_config.rb
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
176
  - !ruby/object:Gem::Version
176
177
  version: '0'
177
178
  requirements: []
178
- rubygems_version: 3.1.4
179
+ rubygems_version: 3.1.6
179
180
  signing_key:
180
181
  specification_version: 4
181
182
  summary: Push db changes to AWS SNS.