db_blaster 0.1.4 → 0.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2de00cf222282fde0e0a3e38078ccc398a80ff19c41ccf7b79ecd043450db6b1
|
4
|
+
data.tar.gz: 66b93222044a44bcd7dd35a6233de5c4839a58d5106e527a7d540be2daee9821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7305baf42dff923be85d8105625bf3ccf8200988d7895c80202a32232b062a9c613863a002a7b8e57d7e57a3660725ab4ed6765d2b2d3ba49f3b216da2614dac
|
7
|
+
data.tar.gz: 8652430ce86f2ee275997ec35e52bf2ba99befa4c3a8630b13e0ca57f309d4b0fb013974806e52882bc37bd95a6c4e9e9d4ea51fa5a2096d2767df0d3608b796
|
@@ -32,8 +32,7 @@ module DbBlaster
|
|
32
32
|
# Applicable only when `s3_bucket' is set
|
33
33
|
# The value set here will be included in every payload pushed to S3
|
34
34
|
# example: config.s3_meta = {'infra_id' => '061', 'source_app' => 'kcp-api'}}
|
35
|
-
# The resulting JSON
|
36
|
-
# {"meta" : {"infra_id" : "061", "src_app" : "kcp-api", "src_table" : "the-table"}, "records" : [] }
|
35
|
+
# The resulting JSON will include the `meta` merged into every record
|
37
36
|
attr_accessor :s3_meta
|
38
37
|
|
39
38
|
# Optional
|
@@ -14,8 +14,7 @@ module DbBlaster
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def content
|
17
|
-
|
18
|
-
records: records }
|
17
|
+
meta_records
|
19
18
|
end
|
20
19
|
|
21
20
|
def tagging
|
@@ -28,7 +27,11 @@ module DbBlaster
|
|
28
27
|
end
|
29
28
|
|
30
29
|
def meta
|
31
|
-
(DbBlaster.configuration.s3_meta.presence || {}).merge(source_table: source_table.name)
|
30
|
+
@meta ||= (DbBlaster.configuration.s3_meta.presence || {}).merge(source_table: source_table.name)
|
31
|
+
end
|
32
|
+
|
33
|
+
def meta_records
|
34
|
+
records.collect { |record| record.merge(meta) }
|
32
35
|
end
|
33
36
|
|
34
37
|
def client
|
data/lib/db_blaster/version.rb
CHANGED
@@ -32,8 +32,7 @@ DbBlaster.configure do |config|
|
|
32
32
|
# Applicable only when `s3_bucket' is set
|
33
33
|
# Extra meta values sent along with each payload
|
34
34
|
# example: config.s3_meta = {'infra_id' => '061'}
|
35
|
-
# The resulting JSON
|
36
|
-
# {"meta" : {"infra_id" : "061", "source_app" : "kcp-api", "src_table" : "the-table"}, "records" : [] }
|
35
|
+
# The resulting JSON will include the `meta` merged into every record.
|
37
36
|
# config.s3_meta = {'infra_id' => '061'}
|
38
37
|
|
39
38
|
# Optional
|