exwiw 0.2.1 → 0.2.2
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/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/exwiw/explain_runner.rb +9 -7
- data/lib/exwiw/runner.rb +11 -6
- data/lib/exwiw/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: 369701f0b142d0660d988630013e5f421c1d4ad817a834615e25177721700abc
|
|
4
|
+
data.tar.gz: 950edc07255a1520bfa9bae067c028160219790ecc84379210e6532054de0ddb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 852cd30d5121dbbbf8d7abeb1fd486c188c4ab177339620d2129ebfed10ef1dfe13a928c34840f082c295e255d0a15e3a72cf1e71151292dce50657bbf125ac5
|
|
7
|
+
data.tar.gz: a57d914dd5794caa00df4323ab84df3c9fcdec5694c0e32fde68d44cc7f78369b3d8359614c55a35608eb2b9d7202af2078ffc1ee0a3a566d69cf1eb5141de72
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.2] - 2026-05-26
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `skip: true` table config now still emits the table's DDL into `insert-000-schema.{sql,js}` so downstream schemas stay consistent; only data extraction (`insert-*` / `delete-*`) is skipped. Previously the table was excluded from the schema file as well.
|
|
10
|
+
|
|
5
11
|
## [0.2.1] - 2026-05-23
|
|
6
12
|
|
|
7
13
|
### Added
|
data/README.md
CHANGED
|
@@ -203,7 +203,7 @@ Note: Ruby hooks are evaluated via `instance_eval` inside the exwiw process —
|
|
|
203
203
|
|
|
204
204
|
### Skip a table
|
|
205
205
|
|
|
206
|
-
Set `"skip": true` on a table's config JSON to
|
|
206
|
+
Set `"skip": true` on a table's config JSON to exclude it from data extraction. The table's DDL is still emitted into `insert-000-schema.{sql,js}` so the schema stays consistent, but no `insert-*` / `delete-*` files are generated for it and the table is never queried.
|
|
207
207
|
|
|
208
208
|
```json
|
|
209
209
|
{
|
data/lib/exwiw/explain_runner.rb
CHANGED
|
@@ -19,7 +19,7 @@ module Exwiw
|
|
|
19
19
|
def run
|
|
20
20
|
adapter = Adapter.build(@connection_config, @logger)
|
|
21
21
|
configs = load_table_config(adapter.class.table_config_class)
|
|
22
|
-
|
|
22
|
+
validate_skipped(configs)
|
|
23
23
|
|
|
24
24
|
table_by_name = configs.each_with_object({}) { |config, hash| hash[config.name] = config }
|
|
25
25
|
|
|
@@ -31,8 +31,13 @@ module Exwiw
|
|
|
31
31
|
|
|
32
32
|
total_size = ordered_table_names.size
|
|
33
33
|
ordered_table_names.each_with_index do |table_name, idx|
|
|
34
|
-
@logger.debug("Explaining '#{table_name}'... (#{idx + 1}/#{total_size})")
|
|
35
34
|
table = table_by_name.fetch(table_name)
|
|
35
|
+
if table.skip
|
|
36
|
+
@logger.debug("Skipping explain for '#{table_name}' (skip:true)")
|
|
37
|
+
next
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
@logger.debug("Explaining '#{table_name}'... (#{idx + 1}/#{total_size})")
|
|
36
41
|
|
|
37
42
|
query_ast = adapter.build_query(table, @dump_target, table_by_name)
|
|
38
43
|
sql = adapter.compile_ast(query_ast)
|
|
@@ -54,9 +59,9 @@ module Exwiw
|
|
|
54
59
|
end
|
|
55
60
|
end
|
|
56
61
|
|
|
57
|
-
private def
|
|
62
|
+
private def validate_skipped(configs)
|
|
58
63
|
skipped_names = configs.select { |c| c.skip }.map(&:name).to_set
|
|
59
|
-
return
|
|
64
|
+
return if skipped_names.empty?
|
|
60
65
|
|
|
61
66
|
configs.each do |config|
|
|
62
67
|
next if config.skip
|
|
@@ -75,9 +80,6 @@ module Exwiw
|
|
|
75
80
|
raise ArgumentError,
|
|
76
81
|
"--target-table '#{@dump_target.table_name}' is marked skip:true and cannot be used as a dump target."
|
|
77
82
|
end
|
|
78
|
-
|
|
79
|
-
skipped_names.each { |n| @logger.info("Skipping table '#{n}' (skip:true)") }
|
|
80
|
-
configs.reject { |c| c.skip }
|
|
81
83
|
end
|
|
82
84
|
end
|
|
83
85
|
end
|
data/lib/exwiw/runner.rb
CHANGED
|
@@ -30,7 +30,7 @@ module Exwiw
|
|
|
30
30
|
adapter = Adapter.build(@connection_config, @logger)
|
|
31
31
|
configs = load_table_config(adapter.class.table_config_class)
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
validate_skipped(configs)
|
|
34
34
|
|
|
35
35
|
table_by_name = configs.each_with_object({}) { |config, hash| hash[config.name] = config }
|
|
36
36
|
|
|
@@ -51,9 +51,15 @@ module Exwiw
|
|
|
51
51
|
|
|
52
52
|
total_size = ordered_table_names.size
|
|
53
53
|
ordered_table_names.each_with_index do |table_name, idx|
|
|
54
|
-
@logger.info("Processing table '#{table_name}'... (#{idx + 1}/#{total_size})")
|
|
55
54
|
table = table_by_name.fetch(table_name)
|
|
56
55
|
|
|
56
|
+
if table.skip
|
|
57
|
+
@logger.info("Skipping data extraction for '#{table_name}' (skip:true)")
|
|
58
|
+
next
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
@logger.info("Processing table '#{table_name}'... (#{idx + 1}/#{total_size})")
|
|
62
|
+
|
|
57
63
|
query_ast = adapter.build_query(table, @dump_target, table_by_name)
|
|
58
64
|
results = adapter.execute(query_ast)
|
|
59
65
|
record_num = results.size
|
|
@@ -123,9 +129,9 @@ module Exwiw
|
|
|
123
129
|
end
|
|
124
130
|
end
|
|
125
131
|
|
|
126
|
-
private def
|
|
132
|
+
private def validate_skipped(configs)
|
|
127
133
|
skipped_names = configs.select { |c| c.skip }.map(&:name).to_set
|
|
128
|
-
return
|
|
134
|
+
return if skipped_names.empty?
|
|
129
135
|
|
|
130
136
|
configs.each do |config|
|
|
131
137
|
next if config.skip
|
|
@@ -145,8 +151,7 @@ module Exwiw
|
|
|
145
151
|
"--target-table '#{@dump_target.table_name}' is marked skip:true and cannot be used as a dump target."
|
|
146
152
|
end
|
|
147
153
|
|
|
148
|
-
skipped_names.each { |n| @logger.info("
|
|
149
|
-
configs.reject { |c| c.skip }
|
|
154
|
+
skipped_names.each { |n| @logger.info("Table '#{n}' is marked skip:true (schema will be included, data extraction skipped)") }
|
|
150
155
|
end
|
|
151
156
|
end
|
|
152
157
|
end
|
data/lib/exwiw/version.rb
CHANGED