table_saw 3.1.0 → 3.3.0

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +9 -13
  3. data/.rubocop.yml +3 -3
  4. data/.tool-versions +1 -1
  5. data/Appraisals +6 -7
  6. data/Gemfile +7 -4
  7. data/Gemfile.lock +124 -110
  8. data/README.md +0 -2
  9. data/exe/table-saw +1 -0
  10. data/gemfiles/{activerecord_6.1.0.gemfile → activerecord_7.2.0.gemfile} +7 -5
  11. data/gemfiles/activerecord_7.2.0.gemfile.lock +216 -0
  12. data/gemfiles/{activerecord_7.1.0.gemfile → activerecord_8.0.0.gemfile} +7 -5
  13. data/gemfiles/activerecord_8.0.0.gemfile.lock +218 -0
  14. data/gemfiles/{activerecord_7.0.0.gemfile → activerecord_8.1.0.gemfile} +7 -5
  15. data/gemfiles/activerecord_8.1.0.gemfile.lock +244 -0
  16. data/lib/table_saw/configuration.rb +1 -1
  17. data/lib/table_saw/create_dump_file.rb +3 -3
  18. data/lib/table_saw/dependency_graph/belongs_to_directives.rb +1 -1
  19. data/lib/table_saw/dependency_graph/build.rb +2 -2
  20. data/lib/table_saw/dependency_graph/dump_table.rb +1 -1
  21. data/lib/table_saw/dependency_graph/has_many_directives.rb +1 -1
  22. data/lib/table_saw/formats/copy.rb +1 -1
  23. data/lib/table_saw/formats/insert.rb +1 -1
  24. data/lib/table_saw/manifest.rb +1 -1
  25. data/lib/table_saw/queries/execute_insert_statement.rb +6 -6
  26. data/lib/table_saw/queries/foreign_key_relationships.rb +1 -2
  27. data/lib/table_saw/queries/materialized_views.rb +1 -1
  28. data/lib/table_saw/queries/prepared_insert_statement.rb +1 -1
  29. data/lib/table_saw/queries/serial_sequences.rb +1 -1
  30. data/lib/table_saw/queries/serialize_sql_in_clause.rb +1 -5
  31. data/lib/table_saw/version.rb +1 -1
  32. data/lib/table_saw.rb +18 -2
  33. data/table_saw.gemspec +2 -2
  34. metadata +12 -17
  35. data/gemfiles/activerecord_6.1.0.gemfile.lock +0 -169
  36. data/gemfiles/activerecord_7.0.0.gemfile.lock +0 -169
  37. data/gemfiles/activerecord_7.1.0.gemfile.lock +0 -204
  38. data/lib/table_saw/connection.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c486b7b157b263797373c6fcd9346e99e1e8d3d0d42bfd993b309b5f4a96032d
4
- data.tar.gz: f6b3ee4493ce2c5b740410db3b5c18e847ab2d7bd663eb0094a5420fd2d83c9b
3
+ metadata.gz: 22239851807e1ad5dadfdfabb9f78ae4ff1d5951209ffe626c2989d7368e0fe2
4
+ data.tar.gz: 78eb40b85de4b2a3a05c5c43d65f03d66c2fe9d6285de426418bc26250648325
5
5
  SHA512:
6
- metadata.gz: 8e86bc39752b2ca0a7bd7b7bf7b162a1c90583ac8e43d6c0299fff36bdd106a446b35a45c1e0a08dc7ec4fc730387de569ef830596e59744920e66224c820835
7
- data.tar.gz: 2350f1710a38280d71ac8587784dbef023685c40dc5d3c87af840bae94761127c23d0efba7da3efbe57ade1ebd1ea9827ba8d94fea6a8c0d4a08e1ca360d6955
6
+ metadata.gz: 42bba4bf487e401bc56ab03c5ae1f451c85f7067fcaa5df98dc52e437b2805b06903d4fd8f4a6c8f1eb96c3973c5b88b89511c6a46245053425ca6e9680ad01f
7
+ data.tar.gz: b767525b7232bd54347b7e27c8e3befac5c0c1c2384bc6d342d3d42aa0569a49ae68d2d3e2678274fd12885881b337dcb555a21f4db3a09f8a3756f76a583760
@@ -10,13 +10,13 @@ jobs:
10
10
  strategy:
11
11
  matrix:
12
12
  ruby:
13
- - '3.0.5'
14
- - '3.1.4'
15
- - '3.2.2'
13
+ - '3.2'
14
+ - '3.3'
15
+ - '3.4'
16
16
  activerecord:
17
- - '6.1.0'
18
- - '7.0.0'
19
- - '7.1.0'
17
+ - '7.2.0'
18
+ - '8.0.0'
19
+ - '8.1.0'
20
20
 
21
21
  env:
22
22
  BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/activerecord_${{ matrix.activerecord }}.gemfile
@@ -34,7 +34,7 @@ jobs:
34
34
  options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
35
35
 
36
36
  steps:
37
- - uses: actions/checkout@v2
37
+ - uses: actions/checkout@v4
38
38
 
39
39
  - name: Set up Ruby
40
40
  uses: ruby/setup-ruby@v1
@@ -47,9 +47,5 @@ jobs:
47
47
  sudo apt-get -yqq install libpq-dev
48
48
 
49
49
  - name: Run tests with RSpec
50
- uses: paambaati/codeclimate-action@v2.7.5
51
- env:
52
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
53
- with:
54
- coverageCommand: bundle exec rspec
55
- debug: false
50
+ run: |
51
+ bundle exec rspec
data/.rubocop.yml CHANGED
@@ -1,8 +1,8 @@
1
- require: rubocop-rspec
1
+ plugins: rubocop-rspec
2
2
 
3
3
  AllCops:
4
4
  NewCops: enable
5
- TargetRubyVersion: 3.0
5
+ TargetRubyVersion: 3.2
6
6
  Exclude:
7
7
  - gemfiles/*
8
8
 
@@ -21,7 +21,7 @@ Lint/RaiseException:
21
21
  Lint/StructNewOverride:
22
22
  Enabled: true
23
23
 
24
- Naming/PredicateName:
24
+ Naming/PredicatePrefix:
25
25
  AllowedMethods:
26
26
  - has_many
27
27
 
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.2.2
1
+ ruby 3.4.7
data/Appraisals CHANGED
@@ -1,14 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'activerecord-6.1.0' do
4
- gem 'activerecord', '~> 6.1', '< 6.2'
3
+ appraise 'activerecord_7.2.0' do
4
+ gem 'activerecord', '~> 7.2.0', '< 7.3'
5
5
  end
6
6
 
7
- appraise 'activerecord-7.0.0' do
8
- gem 'activerecord', '~> 7.0', '< 7.1'
7
+ appraise 'activerecord_8.0.0' do
8
+ gem 'activerecord', '~> 8.0.0', '< 8.1'
9
9
  end
10
10
 
11
- appraise 'activerecord-7.1.0' do
12
- gem 'activerecord', '~> 7.1', '< 7.2'
11
+ appraise 'activerecord_8.1.0' do
12
+ gem 'activerecord', '~> 8.1.0', '< 8.2'
13
13
  end
14
-
data/Gemfile CHANGED
@@ -7,11 +7,14 @@ gemspec
7
7
 
8
8
  gem 'appraisal'
9
9
  gem 'bundler', '~> 2.0'
10
- gem 'combustion', '~> 1.3'
11
- gem 'database_cleaner', '~> 2'
10
+ gem 'combustion', '~> 1.4'
11
+ gem 'database_cleaner-active_record', '~> 2.2'
12
+ gem 'ostruct'
12
13
  gem 'pry'
13
14
  gem 'rake', '13.0.3'
14
- gem 'rspec', '~> 3.0'
15
- gem 'rubocop-rspec', '~> 2.3'
15
+ gem 'rspec', '~> 3.13'
16
+ gem 'rubocop-rspec', '~> 3.5'
16
17
  gem 'scenic', '~> 1.5'
17
18
  gem 'simplecov', '~> 0.16'
19
+ # The following version lock is necessary to support Ruby 3.1
20
+ gem 'zeitwerk', '~> 2.6.0'
data/Gemfile.lock CHANGED
@@ -1,186 +1,198 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_saw (3.1.0)
5
- activerecord (>= 6.0)
4
+ table_saw (3.3.0)
5
+ activerecord (>= 7.1)
6
6
  pg
7
7
  thor
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (7.1.2)
13
- actionview (= 7.1.2)
14
- activesupport (= 7.1.2)
12
+ actionpack (8.1.1)
13
+ actionview (= 8.1.1)
14
+ activesupport (= 8.1.1)
15
15
  nokogiri (>= 1.8.5)
16
- racc
17
16
  rack (>= 2.2.4)
18
17
  rack-session (>= 1.0.1)
19
18
  rack-test (>= 0.6.3)
20
19
  rails-dom-testing (~> 2.2)
21
20
  rails-html-sanitizer (~> 1.6)
22
- actionview (7.1.2)
23
- activesupport (= 7.1.2)
21
+ useragent (~> 0.16)
22
+ actionview (8.1.1)
23
+ activesupport (= 8.1.1)
24
24
  builder (~> 3.1)
25
25
  erubi (~> 1.11)
26
26
  rails-dom-testing (~> 2.2)
27
27
  rails-html-sanitizer (~> 1.6)
28
- activemodel (7.1.2)
29
- activesupport (= 7.1.2)
30
- activerecord (7.1.2)
31
- activemodel (= 7.1.2)
32
- activesupport (= 7.1.2)
28
+ activemodel (8.1.1)
29
+ activesupport (= 8.1.1)
30
+ activerecord (8.1.1)
31
+ activemodel (= 8.1.1)
32
+ activesupport (= 8.1.1)
33
33
  timeout (>= 0.4.0)
34
- activesupport (7.1.2)
34
+ activesupport (8.1.1)
35
35
  base64
36
36
  bigdecimal
37
- concurrent-ruby (~> 1.0, >= 1.0.2)
37
+ concurrent-ruby (~> 1.0, >= 1.3.1)
38
38
  connection_pool (>= 2.2.5)
39
39
  drb
40
40
  i18n (>= 1.6, < 2)
41
+ json
42
+ logger (>= 1.4.2)
41
43
  minitest (>= 5.1)
42
- mutex_m
43
- tzinfo (~> 2.0)
44
+ securerandom (>= 0.3)
45
+ tzinfo (~> 2.0, >= 2.0.5)
46
+ uri (>= 0.13.1)
44
47
  appraisal (2.5.0)
45
48
  bundler
46
49
  rake
47
50
  thor (>= 0.14.0)
48
- ast (2.4.2)
49
- base64 (0.2.0)
50
- bigdecimal (3.1.5)
51
- builder (3.2.4)
51
+ ast (2.4.3)
52
+ base64 (0.3.0)
53
+ bigdecimal (3.3.1)
54
+ builder (3.3.0)
52
55
  coderay (1.1.3)
53
- combustion (1.3.7)
56
+ combustion (1.5.0)
54
57
  activesupport (>= 3.0.0)
55
58
  railties (>= 3.0.0)
56
59
  thor (>= 0.14.6)
57
- concurrent-ruby (1.2.2)
58
- connection_pool (2.4.1)
60
+ concurrent-ruby (1.3.5)
61
+ connection_pool (2.5.4)
59
62
  crass (1.0.6)
60
- database_cleaner (2.0.2)
61
- database_cleaner-active_record (>= 2, < 3)
62
- database_cleaner-active_record (2.1.0)
63
+ database_cleaner-active_record (2.2.2)
63
64
  activerecord (>= 5.a)
64
- database_cleaner-core (~> 2.0.0)
65
+ database_cleaner-core (~> 2.0)
65
66
  database_cleaner-core (2.0.1)
66
- diff-lcs (1.5.0)
67
- docile (1.4.0)
68
- drb (2.2.0)
69
- ruby2_keywords
70
- erubi (1.12.0)
71
- i18n (1.14.1)
67
+ date (3.5.0)
68
+ diff-lcs (1.6.2)
69
+ docile (1.4.1)
70
+ drb (2.2.3)
71
+ erb (5.1.3)
72
+ erubi (1.13.1)
73
+ i18n (1.14.7)
72
74
  concurrent-ruby (~> 1.0)
73
- io-console (0.7.1)
74
- irb (1.11.0)
75
- rdoc
76
- reline (>= 0.3.8)
77
- json (2.7.1)
78
- language_server-protocol (3.17.0.3)
79
- loofah (2.22.0)
75
+ io-console (0.8.1)
76
+ irb (1.15.3)
77
+ pp (>= 0.6.0)
78
+ rdoc (>= 4.0.0)
79
+ reline (>= 0.4.2)
80
+ json (2.15.2)
81
+ language_server-protocol (3.17.0.5)
82
+ lint_roller (1.1.0)
83
+ logger (1.7.0)
84
+ loofah (2.24.1)
80
85
  crass (~> 1.0.2)
81
86
  nokogiri (>= 1.12.0)
82
- method_source (1.0.0)
83
- mini_portile2 (2.8.5)
84
- minitest (5.20.0)
85
- mutex_m (0.2.0)
86
- nokogiri (1.15.5)
87
+ method_source (1.1.0)
88
+ mini_portile2 (2.8.9)
89
+ minitest (5.26.0)
90
+ nokogiri (1.18.10)
87
91
  mini_portile2 (~> 2.8.2)
88
92
  racc (~> 1.4)
89
- parallel (1.24.0)
90
- parser (3.2.2.4)
93
+ ostruct (0.6.3)
94
+ parallel (1.27.0)
95
+ parser (3.3.10.0)
91
96
  ast (~> 2.4.1)
92
97
  racc
93
- pg (1.5.4)
94
- pry (0.14.2)
98
+ pg (1.6.2)
99
+ pp (0.6.3)
100
+ prettyprint
101
+ prettyprint (0.2.0)
102
+ prism (1.6.0)
103
+ pry (0.15.2)
95
104
  coderay (~> 1.1)
96
105
  method_source (~> 1.0)
97
- psych (5.1.2)
106
+ psych (5.2.6)
107
+ date
98
108
  stringio
99
- racc (1.7.3)
100
- rack (3.0.8)
101
- rack-session (2.0.0)
109
+ racc (1.8.1)
110
+ rack (3.2.3)
111
+ rack-session (2.1.1)
112
+ base64 (>= 0.1.0)
102
113
  rack (>= 3.0.0)
103
- rack-test (2.1.0)
114
+ rack-test (2.2.0)
104
115
  rack (>= 1.3)
105
- rackup (2.1.0)
116
+ rackup (2.2.1)
106
117
  rack (>= 3)
107
- webrick (~> 1.8)
108
- rails-dom-testing (2.2.0)
118
+ rails-dom-testing (2.3.0)
109
119
  activesupport (>= 5.0.0)
110
120
  minitest
111
121
  nokogiri (>= 1.6)
112
- rails-html-sanitizer (1.6.0)
122
+ rails-html-sanitizer (1.6.2)
113
123
  loofah (~> 2.21)
114
- nokogiri (~> 1.14)
115
- railties (7.1.2)
116
- actionpack (= 7.1.2)
117
- activesupport (= 7.1.2)
118
- irb
124
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
125
+ railties (8.1.1)
126
+ actionpack (= 8.1.1)
127
+ activesupport (= 8.1.1)
128
+ irb (~> 1.13)
119
129
  rackup (>= 1.0.0)
120
130
  rake (>= 12.2)
121
131
  thor (~> 1.0, >= 1.2.2)
132
+ tsort (>= 0.2)
122
133
  zeitwerk (~> 2.6)
123
134
  rainbow (3.1.1)
124
135
  rake (13.0.3)
125
- rdoc (6.6.2)
136
+ rdoc (6.15.1)
137
+ erb
126
138
  psych (>= 4.0.0)
127
- regexp_parser (2.8.3)
128
- reline (0.4.1)
139
+ tsort
140
+ regexp_parser (2.11.3)
141
+ reline (0.6.2)
129
142
  io-console (~> 0.5)
130
- rexml (3.2.6)
131
- rspec (3.12.0)
132
- rspec-core (~> 3.12.0)
133
- rspec-expectations (~> 3.12.0)
134
- rspec-mocks (~> 3.12.0)
135
- rspec-core (3.12.2)
136
- rspec-support (~> 3.12.0)
137
- rspec-expectations (3.12.3)
143
+ rspec (3.13.2)
144
+ rspec-core (~> 3.13.0)
145
+ rspec-expectations (~> 3.13.0)
146
+ rspec-mocks (~> 3.13.0)
147
+ rspec-core (3.13.6)
148
+ rspec-support (~> 3.13.0)
149
+ rspec-expectations (3.13.5)
138
150
  diff-lcs (>= 1.2.0, < 2.0)
139
- rspec-support (~> 3.12.0)
140
- rspec-mocks (3.12.6)
151
+ rspec-support (~> 3.13.0)
152
+ rspec-mocks (3.13.7)
141
153
  diff-lcs (>= 1.2.0, < 2.0)
142
- rspec-support (~> 3.12.0)
143
- rspec-support (3.12.1)
144
- rubocop (1.59.0)
154
+ rspec-support (~> 3.13.0)
155
+ rspec-support (3.13.6)
156
+ rubocop (1.81.7)
145
157
  json (~> 2.3)
146
- language_server-protocol (>= 3.17.0)
158
+ language_server-protocol (~> 3.17.0.2)
159
+ lint_roller (~> 1.1.0)
147
160
  parallel (~> 1.10)
148
- parser (>= 3.2.2.4)
161
+ parser (>= 3.3.0.2)
149
162
  rainbow (>= 2.2.2, < 4.0)
150
- regexp_parser (>= 1.8, < 3.0)
151
- rexml (>= 3.2.5, < 4.0)
152
- rubocop-ast (>= 1.30.0, < 2.0)
163
+ regexp_parser (>= 2.9.3, < 3.0)
164
+ rubocop-ast (>= 1.47.1, < 2.0)
153
165
  ruby-progressbar (~> 1.7)
154
- unicode-display_width (>= 2.4.0, < 3.0)
155
- rubocop-ast (1.30.0)
156
- parser (>= 3.2.1.0)
157
- rubocop-capybara (2.19.0)
158
- rubocop (~> 1.41)
159
- rubocop-factory_bot (2.24.0)
160
- rubocop (~> 1.33)
161
- rubocop-rspec (2.25.0)
162
- rubocop (~> 1.40)
163
- rubocop-capybara (~> 2.17)
164
- rubocop-factory_bot (~> 2.22)
166
+ unicode-display_width (>= 2.4.0, < 4.0)
167
+ rubocop-ast (1.47.1)
168
+ parser (>= 3.3.7.2)
169
+ prism (~> 1.4)
170
+ rubocop-rspec (3.7.0)
171
+ lint_roller (~> 1.1)
172
+ rubocop (~> 1.72, >= 1.72.1)
165
173
  ruby-progressbar (1.13.0)
166
- ruby2_keywords (0.0.5)
167
- scenic (1.7.0)
174
+ scenic (1.9.0)
168
175
  activerecord (>= 4.0.0)
169
176
  railties (>= 4.0.0)
177
+ securerandom (0.4.1)
170
178
  simplecov (0.22.0)
171
179
  docile (~> 1.1)
172
180
  simplecov-html (~> 0.11)
173
181
  simplecov_json_formatter (~> 0.1)
174
- simplecov-html (0.12.3)
182
+ simplecov-html (0.13.2)
175
183
  simplecov_json_formatter (0.1.4)
176
- stringio (3.1.0)
177
- thor (1.3.0)
178
- timeout (0.4.1)
184
+ stringio (3.1.7)
185
+ thor (1.4.0)
186
+ timeout (0.4.4)
187
+ tsort (0.2.0)
179
188
  tzinfo (2.0.6)
180
189
  concurrent-ruby (~> 1.0)
181
- unicode-display_width (2.5.0)
182
- webrick (1.8.1)
183
- zeitwerk (2.6.12)
190
+ unicode-display_width (3.2.0)
191
+ unicode-emoji (~> 4.1)
192
+ unicode-emoji (4.1.0)
193
+ uri (1.1.0)
194
+ useragent (0.16.11)
195
+ zeitwerk (2.6.18)
184
196
 
185
197
  PLATFORMS
186
198
  ruby
@@ -188,15 +200,17 @@ PLATFORMS
188
200
  DEPENDENCIES
189
201
  appraisal
190
202
  bundler (~> 2.0)
191
- combustion (~> 1.3)
192
- database_cleaner (~> 2)
203
+ combustion (~> 1.4)
204
+ database_cleaner-active_record (~> 2.2)
205
+ ostruct
193
206
  pry
194
207
  rake (= 13.0.3)
195
- rspec (~> 3.0)
196
- rubocop-rspec (~> 2.3)
208
+ rspec (~> 3.13)
209
+ rubocop-rspec (~> 3.5)
197
210
  scenic (~> 1.5)
198
211
  simplecov (~> 0.16)
199
212
  table_saw!
213
+ zeitwerk (~> 2.6.0)
200
214
 
201
215
  BUNDLED WITH
202
- 2.4.13
216
+ 2.7.2
data/README.md CHANGED
@@ -1,6 +1,4 @@
1
1
  ![](https://github.com/hasghari/table_saw/workflows/Ruby/badge.svg)
2
- [![Maintainability](https://api.codeclimate.com/v1/badges/abd5b5451c764d3249f1/maintainability)](https://codeclimate.com/github/hasghari/table_saw/maintainability)
3
- [![Test Coverage](https://api.codeclimate.com/v1/badges/abd5b5451c764d3249f1/test_coverage)](https://codeclimate.com/github/hasghari/table_saw/test_coverage)
4
2
 
5
3
  # table-saw
6
4
 
data/exe/table-saw CHANGED
@@ -29,6 +29,7 @@ class CLI < Thor
29
29
  desc: 'This option takes a hash to override variables provided in the manifest'
30
30
  def dump
31
31
  TableSaw.configure(options.to_hash)
32
+ ::ActiveRecord::Base.establish_connection(TableSaw.configuration.connection)
32
33
  records = TableSaw::DependencyGraph::Build.new(TableSaw::Manifest.instance).call
33
34
  TableSaw::CreateDumpFile.new(records, output: options[:output], format: options[:format]).call
34
35
  end
@@ -4,14 +4,16 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
6
  gem "bundler", "~> 2.0"
7
- gem "combustion", "~> 1.3"
8
- gem "database_cleaner", "~> 2"
7
+ gem "combustion", "~> 1.4"
8
+ gem "database_cleaner-active_record", "~> 2.2"
9
+ gem "ostruct"
9
10
  gem "pry"
10
11
  gem "rake", "13.0.3"
11
- gem "rspec", "~> 3.0"
12
- gem "rubocop-rspec", "~> 2.3"
12
+ gem "rspec", "~> 3.13"
13
+ gem "rubocop-rspec", "~> 3.5"
13
14
  gem "scenic", "~> 1.5"
14
15
  gem "simplecov", "~> 0.16"
15
- gem "activerecord", "~> 6.1", "< 6.2"
16
+ gem "zeitwerk", "~> 2.6.0"
17
+ gem "activerecord", "~> 7.2.0", "< 7.3"
16
18
 
17
19
  gemspec path: "../"