db_blaster 0.1.8 → 0.1.9
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e58f97f7c15cb1bb2d1bf1d4235e68e5d256adaf48f72481cb3c754f1d85aae
|
4
|
+
data.tar.gz: ffa443a609d6d2b10b7e7e3b65bdc45da8abfc8485b7f3fb46fa638ea1b0cd98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
19
|
-
ActiveRecord::Base.connection.columns(
|
20
|
-
next if
|
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
|
data/lib/db_blaster/version.rb
CHANGED
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.
|
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-
|
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.
|
179
|
+
rubygems_version: 3.1.6
|
179
180
|
signing_key:
|
180
181
|
specification_version: 4
|
181
182
|
summary: Push db changes to AWS SNS.
|