table_saw 2.4.2 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +65 -0
- data/.rubocop.yml +24 -3
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/Appraisals +7 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +67 -61
- data/README.md +1 -1
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/activerecord_6.0.0.gemfile +8 -0
- data/gemfiles/activerecord_6.0.0.gemfile.lock +148 -0
- data/gemfiles/activerecord_6.1.0.gemfile +8 -0
- data/gemfiles/activerecord_6.1.0.gemfile.lock +147 -0
- data/lib/table_saw/associations.rb +40 -0
- data/lib/table_saw/dependency_graph/belongs_to_directives.rb +19 -15
- data/lib/table_saw/dependency_graph/dump_table.rb +1 -1
- data/lib/table_saw/dependency_graph/has_many_directives.rb +20 -15
- data/lib/table_saw/foreign_key.rb +63 -0
- data/lib/table_saw/information_schema.rb +2 -6
- data/lib/table_saw/manifest.rb +9 -0
- data/lib/table_saw/queries/execute_insert_statement.rb +6 -5
- data/lib/table_saw/queries/foreign_key_relationships.rb +11 -12
- data/lib/table_saw/queries/prepared_insert_statement.rb +7 -1
- data/lib/table_saw/queries/serialize_sql_in_clause.rb +1 -1
- data/lib/table_saw/version.rb +1 -1
- data/table_saw.gemspec +2 -2
- metadata +21 -12
- data/.travis.yml +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c7879158171aacb00de1642a7b68d9df7ec27a9a972e5950ad45743e89730db
|
4
|
+
data.tar.gz: e78cb24aff6cc86ab5aa18c3fc66829793b5cce31b020fe00ae0e0293ce47ea3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24e4531703366fe1a6c3f524c706fb2d6e677a2ec509f4e66cef61076fe8b588c6d031ea66914707a0f9d2fc93f33fd5dcb23849c0aceb6d0c889623cdd357a3
|
7
|
+
data.tar.gz: bbb17e412000aa021a97132bf7dc681381e24e83bd23cf0b817058ff6caaa72953f7294a0bdac1b3c161e7ef0decc9264f4444b946d71cfe8f8ff3aa851818fd
|
@@ -0,0 +1,65 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby:
|
13
|
+
- 2.6.x
|
14
|
+
- 2.7.x
|
15
|
+
activerecord:
|
16
|
+
- 6.0.0
|
17
|
+
- 6.1.0
|
18
|
+
|
19
|
+
env:
|
20
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/activerecord_${{ matrix.activerecord }}.gemfile
|
21
|
+
|
22
|
+
services:
|
23
|
+
postgres:
|
24
|
+
image: postgres:12.4
|
25
|
+
env:
|
26
|
+
POSTGRES_USER: postgres
|
27
|
+
POSTGRES_PASSWORD: postgres
|
28
|
+
POSTGRES_DB: table_saw_test
|
29
|
+
ports:
|
30
|
+
- 5432:5432
|
31
|
+
# needed because the postgres container does not provide a healthcheck
|
32
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
33
|
+
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
|
37
|
+
- name: Set up Ruby
|
38
|
+
uses: actions/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: ${{ matrix.ruby }}
|
41
|
+
|
42
|
+
- uses: actions/cache@v1
|
43
|
+
with:
|
44
|
+
path: vendor/bundle
|
45
|
+
key: ${{ runner.os }}-gems-${{ hashFiles(format('gemfiles/activerecord_{0}.gemfile.lock', matrix.activerecord)) }}
|
46
|
+
restore-keys: |
|
47
|
+
${{ runner.os }}-gems-
|
48
|
+
|
49
|
+
- name: Install PostgreSQL client
|
50
|
+
run: |
|
51
|
+
sudo apt-get -yqq install libpq-dev
|
52
|
+
|
53
|
+
- name: Configure Bundler
|
54
|
+
run: |
|
55
|
+
gem install bundler -v 2.1.4 --no-document
|
56
|
+
bundle config set path 'vendor/bundle'
|
57
|
+
bundle install --jobs 4 --retry 3
|
58
|
+
|
59
|
+
- name: Run tests with RSpec
|
60
|
+
uses: paambaati/codeclimate-action@v2.5.4
|
61
|
+
env:
|
62
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
63
|
+
with:
|
64
|
+
coverageCommand: bundle exec rspec
|
65
|
+
debug: false
|
data/.rubocop.yml
CHANGED
@@ -3,14 +3,23 @@ require: rubocop-rspec
|
|
3
3
|
AllCops:
|
4
4
|
TargetRubyVersion: 2.6
|
5
5
|
|
6
|
+
Layout/LineLength:
|
7
|
+
Max: 120
|
8
|
+
|
6
9
|
Layout/MultilineMethodCallIndentation:
|
7
10
|
EnforcedStyle: indented_relative_to_receiver
|
8
11
|
|
9
|
-
|
10
|
-
|
12
|
+
Layout/SpaceAroundMethodCallOperator:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
Lint/RaiseException:
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
Lint/StructNewOverride:
|
19
|
+
Enabled: true
|
11
20
|
|
12
21
|
Naming/PredicateName:
|
13
|
-
|
22
|
+
AllowedMethods:
|
14
23
|
- has_many
|
15
24
|
|
16
25
|
Style/Documentation:
|
@@ -19,9 +28,21 @@ Style/Documentation:
|
|
19
28
|
Style/EmptyMethod:
|
20
29
|
EnforcedStyle: expanded
|
21
30
|
|
31
|
+
Style/ExponentialNotation:
|
32
|
+
Enabled: true
|
33
|
+
|
22
34
|
Style/FormatStringToken:
|
23
35
|
EnforcedStyle: template
|
24
36
|
|
37
|
+
Style/HashEachMethods:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
Style/HashTransformKeys:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Style/HashTransformValues:
|
44
|
+
Enabled: true
|
45
|
+
|
25
46
|
Style/PercentLiteralDelimiters:
|
26
47
|
PreferredDelimiters:
|
27
48
|
default: ()
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.6
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.2
|
data/Appraisals
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
table_saw (2.
|
4
|
+
table_saw (2.8.0)
|
5
5
|
activerecord (>= 5.2)
|
6
6
|
pg
|
7
7
|
thor
|
@@ -9,63 +9,67 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (6.0
|
13
|
-
actionview (= 6.0
|
14
|
-
activesupport (= 6.0
|
15
|
-
rack (~> 2.0)
|
12
|
+
actionpack (6.1.0)
|
13
|
+
actionview (= 6.1.0)
|
14
|
+
activesupport (= 6.1.0)
|
15
|
+
rack (~> 2.0, >= 2.0.9)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
-
actionview (6.0
|
20
|
-
activesupport (= 6.0
|
19
|
+
actionview (6.1.0)
|
20
|
+
activesupport (= 6.1.0)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
-
activemodel (6.0
|
26
|
-
activesupport (= 6.0
|
27
|
-
activerecord (6.0
|
28
|
-
activemodel (= 6.0
|
29
|
-
activesupport (= 6.0
|
30
|
-
activesupport (6.0
|
25
|
+
activemodel (6.1.0)
|
26
|
+
activesupport (= 6.1.0)
|
27
|
+
activerecord (6.1.0)
|
28
|
+
activemodel (= 6.1.0)
|
29
|
+
activesupport (= 6.1.0)
|
30
|
+
activesupport (6.1.0)
|
31
31
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
|
-
i18n (>=
|
33
|
-
minitest (
|
34
|
-
tzinfo (~>
|
35
|
-
zeitwerk (~> 2.
|
32
|
+
i18n (>= 1.6, < 2)
|
33
|
+
minitest (>= 5.1)
|
34
|
+
tzinfo (~> 2.0)
|
35
|
+
zeitwerk (~> 2.3)
|
36
|
+
appraisal (2.3.0)
|
37
|
+
bundler
|
38
|
+
rake
|
39
|
+
thor (>= 0.14.0)
|
36
40
|
ast (2.4.0)
|
37
|
-
builder (3.2.
|
41
|
+
builder (3.2.4)
|
38
42
|
coderay (1.1.2)
|
39
|
-
combustion (1.1
|
43
|
+
combustion (1.3.1)
|
40
44
|
activesupport (>= 3.0.0)
|
41
45
|
railties (>= 3.0.0)
|
42
46
|
thor (>= 0.14.6)
|
43
|
-
concurrent-ruby (1.1.
|
44
|
-
crass (1.0.
|
47
|
+
concurrent-ruby (1.1.7)
|
48
|
+
crass (1.0.6)
|
45
49
|
database_cleaner (1.7.0)
|
46
50
|
diff-lcs (1.3)
|
47
51
|
docile (1.3.1)
|
48
|
-
erubi (1.
|
49
|
-
i18n (1.
|
52
|
+
erubi (1.10.0)
|
53
|
+
i18n (1.8.5)
|
50
54
|
concurrent-ruby (~> 1.0)
|
51
|
-
jaro_winkler (1.5.
|
52
|
-
json (2.
|
53
|
-
loofah (2.
|
55
|
+
jaro_winkler (1.5.4)
|
56
|
+
json (2.3.1)
|
57
|
+
loofah (2.8.0)
|
54
58
|
crass (~> 1.0.2)
|
55
59
|
nokogiri (>= 1.5.9)
|
56
60
|
method_source (0.9.2)
|
57
61
|
mini_portile2 (2.4.0)
|
58
|
-
minitest (5.
|
59
|
-
nokogiri (1.10.
|
62
|
+
minitest (5.14.2)
|
63
|
+
nokogiri (1.10.10)
|
60
64
|
mini_portile2 (~> 2.4.0)
|
61
|
-
parallel (1.
|
62
|
-
parser (2.
|
65
|
+
parallel (1.19.1)
|
66
|
+
parser (2.7.1.2)
|
63
67
|
ast (~> 2.4.0)
|
64
|
-
pg (1.
|
68
|
+
pg (1.2.3)
|
65
69
|
pry (0.12.2)
|
66
70
|
coderay (~> 1.1.0)
|
67
71
|
method_source (~> 0.9.0)
|
68
|
-
rack (2.
|
72
|
+
rack (2.2.3)
|
69
73
|
rack-test (1.1.0)
|
70
74
|
rack (>= 1.0, < 3)
|
71
75
|
rails-dom-testing (2.0.3)
|
@@ -73,38 +77,40 @@ GEM
|
|
73
77
|
nokogiri (>= 1.6)
|
74
78
|
rails-html-sanitizer (1.3.0)
|
75
79
|
loofah (~> 2.3)
|
76
|
-
railties (6.0
|
77
|
-
actionpack (= 6.0
|
78
|
-
activesupport (= 6.0
|
80
|
+
railties (6.1.0)
|
81
|
+
actionpack (= 6.1.0)
|
82
|
+
activesupport (= 6.1.0)
|
79
83
|
method_source
|
80
84
|
rake (>= 0.8.7)
|
81
|
-
thor (
|
85
|
+
thor (~> 1.0)
|
82
86
|
rainbow (3.0.0)
|
83
|
-
rake (
|
84
|
-
|
85
|
-
|
86
|
-
rspec-
|
87
|
-
rspec-
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
rake (13.0.1)
|
88
|
+
rexml (3.2.4)
|
89
|
+
rspec (3.9.0)
|
90
|
+
rspec-core (~> 3.9.0)
|
91
|
+
rspec-expectations (~> 3.9.0)
|
92
|
+
rspec-mocks (~> 3.9.0)
|
93
|
+
rspec-core (3.9.1)
|
94
|
+
rspec-support (~> 3.9.1)
|
95
|
+
rspec-expectations (3.9.0)
|
91
96
|
diff-lcs (>= 1.2.0, < 2.0)
|
92
|
-
rspec-support (~> 3.
|
93
|
-
rspec-mocks (3.
|
97
|
+
rspec-support (~> 3.9.0)
|
98
|
+
rspec-mocks (3.9.1)
|
94
99
|
diff-lcs (>= 1.2.0, < 2.0)
|
95
|
-
rspec-support (~> 3.
|
96
|
-
rspec-support (3.
|
97
|
-
rubocop (0.
|
100
|
+
rspec-support (~> 3.9.0)
|
101
|
+
rspec-support (3.9.2)
|
102
|
+
rubocop (0.82.0)
|
98
103
|
jaro_winkler (~> 1.5.1)
|
99
104
|
parallel (~> 1.10)
|
100
|
-
parser (>= 2.
|
105
|
+
parser (>= 2.7.0.1)
|
101
106
|
rainbow (>= 2.2.2, < 4.0)
|
107
|
+
rexml
|
102
108
|
ruby-progressbar (~> 1.7)
|
103
|
-
unicode-display_width (>= 1.4.0, <
|
109
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
104
110
|
rubocop-rspec (1.33.0)
|
105
111
|
rubocop (>= 0.60.0)
|
106
112
|
ruby-progressbar (1.10.1)
|
107
|
-
scenic (1.5.
|
113
|
+
scenic (1.5.4)
|
108
114
|
activerecord (>= 4.0.0)
|
109
115
|
railties (>= 4.0.0)
|
110
116
|
simplecov (0.16.1)
|
@@ -112,22 +118,22 @@ GEM
|
|
112
118
|
json (>= 1.8, < 3)
|
113
119
|
simplecov-html (~> 0.10.0)
|
114
120
|
simplecov-html (0.10.2)
|
115
|
-
thor (0.
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
zeitwerk (2.2.2)
|
121
|
+
thor (1.0.1)
|
122
|
+
tzinfo (2.0.3)
|
123
|
+
concurrent-ruby (~> 1.0)
|
124
|
+
unicode-display_width (1.7.0)
|
125
|
+
zeitwerk (2.4.2)
|
121
126
|
|
122
127
|
PLATFORMS
|
123
128
|
ruby
|
124
129
|
|
125
130
|
DEPENDENCIES
|
131
|
+
appraisal
|
126
132
|
bundler (~> 2.0)
|
127
|
-
combustion (~> 1.
|
133
|
+
combustion (~> 1.3)
|
128
134
|
database_cleaner (~> 1.7)
|
129
135
|
pry
|
130
|
-
rake (~>
|
136
|
+
rake (~> 13.0)
|
131
137
|
rspec (~> 3.0)
|
132
138
|
rubocop-rspec (~> 1.33)
|
133
139
|
scenic (~> 1.5)
|
@@ -135,4 +141,4 @@ DEPENDENCIES
|
|
135
141
|
table_saw!
|
136
142
|
|
137
143
|
BUNDLED WITH
|
138
|
-
2.
|
144
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
![](https://github.com/hasghari/table_saw/workflows/Ruby/badge.svg)
|
2
2
|
[![Maintainability](https://api.codeclimate.com/v1/badges/abd5b5451c764d3249f1/maintainability)](https://codeclimate.com/github/hasghari/table_saw/maintainability)
|
3
3
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/abd5b5451c764d3249f1/test_coverage)](https://codeclimate.com/github/hasghari/table_saw/test_coverage)
|
4
4
|
|
@@ -0,0 +1,148 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
table_saw (2.7.0)
|
5
|
+
activerecord (>= 5.2)
|
6
|
+
pg
|
7
|
+
thor
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actionpack (6.0.0)
|
13
|
+
actionview (= 6.0.0)
|
14
|
+
activesupport (= 6.0.0)
|
15
|
+
rack (~> 2.0)
|
16
|
+
rack-test (>= 0.6.3)
|
17
|
+
rails-dom-testing (~> 2.0)
|
18
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
+
actionview (6.0.0)
|
20
|
+
activesupport (= 6.0.0)
|
21
|
+
builder (~> 3.1)
|
22
|
+
erubi (~> 1.4)
|
23
|
+
rails-dom-testing (~> 2.0)
|
24
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
+
activemodel (6.0.0)
|
26
|
+
activesupport (= 6.0.0)
|
27
|
+
activerecord (6.0.0)
|
28
|
+
activemodel (= 6.0.0)
|
29
|
+
activesupport (= 6.0.0)
|
30
|
+
activesupport (6.0.0)
|
31
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
|
+
i18n (>= 0.7, < 2)
|
33
|
+
minitest (~> 5.1)
|
34
|
+
tzinfo (~> 1.1)
|
35
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
36
|
+
appraisal (2.3.0)
|
37
|
+
bundler
|
38
|
+
rake
|
39
|
+
thor (>= 0.14.0)
|
40
|
+
ast (2.4.1)
|
41
|
+
builder (3.2.4)
|
42
|
+
coderay (1.1.3)
|
43
|
+
combustion (1.3.1)
|
44
|
+
activesupport (>= 3.0.0)
|
45
|
+
railties (>= 3.0.0)
|
46
|
+
thor (>= 0.14.6)
|
47
|
+
concurrent-ruby (1.1.7)
|
48
|
+
crass (1.0.6)
|
49
|
+
database_cleaner (1.8.5)
|
50
|
+
diff-lcs (1.4.4)
|
51
|
+
docile (1.3.2)
|
52
|
+
erubi (1.10.0)
|
53
|
+
i18n (1.8.5)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
loofah (2.8.0)
|
56
|
+
crass (~> 1.0.2)
|
57
|
+
nokogiri (>= 1.5.9)
|
58
|
+
method_source (1.0.0)
|
59
|
+
mini_portile2 (2.4.0)
|
60
|
+
minitest (5.14.2)
|
61
|
+
nokogiri (1.10.10)
|
62
|
+
mini_portile2 (~> 2.4.0)
|
63
|
+
parallel (1.20.1)
|
64
|
+
parser (2.7.2.0)
|
65
|
+
ast (~> 2.4.1)
|
66
|
+
pg (1.2.3)
|
67
|
+
pry (0.13.1)
|
68
|
+
coderay (~> 1.1)
|
69
|
+
method_source (~> 1.0)
|
70
|
+
rack (2.2.3)
|
71
|
+
rack-test (1.1.0)
|
72
|
+
rack (>= 1.0, < 3)
|
73
|
+
rails-dom-testing (2.0.3)
|
74
|
+
activesupport (>= 4.2.0)
|
75
|
+
nokogiri (>= 1.6)
|
76
|
+
rails-html-sanitizer (1.3.0)
|
77
|
+
loofah (~> 2.3)
|
78
|
+
railties (6.0.0)
|
79
|
+
actionpack (= 6.0.0)
|
80
|
+
activesupport (= 6.0.0)
|
81
|
+
method_source
|
82
|
+
rake (>= 0.8.7)
|
83
|
+
thor (>= 0.20.3, < 2.0)
|
84
|
+
rainbow (3.0.0)
|
85
|
+
rake (13.0.1)
|
86
|
+
regexp_parser (2.0.0)
|
87
|
+
rexml (3.2.4)
|
88
|
+
rspec (3.9.0)
|
89
|
+
rspec-core (~> 3.9.0)
|
90
|
+
rspec-expectations (~> 3.9.0)
|
91
|
+
rspec-mocks (~> 3.9.0)
|
92
|
+
rspec-core (3.9.3)
|
93
|
+
rspec-support (~> 3.9.3)
|
94
|
+
rspec-expectations (3.9.4)
|
95
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
+
rspec-support (~> 3.9.0)
|
97
|
+
rspec-mocks (3.9.1)
|
98
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
+
rspec-support (~> 3.9.0)
|
100
|
+
rspec-support (3.9.4)
|
101
|
+
rubocop (0.93.1)
|
102
|
+
parallel (~> 1.10)
|
103
|
+
parser (>= 2.7.1.5)
|
104
|
+
rainbow (>= 2.2.2, < 4.0)
|
105
|
+
regexp_parser (>= 1.8)
|
106
|
+
rexml
|
107
|
+
rubocop-ast (>= 0.6.0)
|
108
|
+
ruby-progressbar (~> 1.7)
|
109
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
110
|
+
rubocop-ast (1.3.0)
|
111
|
+
parser (>= 2.7.1.5)
|
112
|
+
rubocop-rspec (1.44.1)
|
113
|
+
rubocop (~> 0.87)
|
114
|
+
rubocop-ast (>= 0.7.1)
|
115
|
+
ruby-progressbar (1.10.1)
|
116
|
+
scenic (1.5.2)
|
117
|
+
activerecord (>= 4.0.0)
|
118
|
+
railties (>= 4.0.0)
|
119
|
+
simplecov (0.19.1)
|
120
|
+
docile (~> 1.1)
|
121
|
+
simplecov-html (~> 0.11)
|
122
|
+
simplecov-html (0.12.3)
|
123
|
+
thor (1.0.1)
|
124
|
+
thread_safe (0.3.6)
|
125
|
+
tzinfo (1.2.8)
|
126
|
+
thread_safe (~> 0.1)
|
127
|
+
unicode-display_width (1.7.0)
|
128
|
+
zeitwerk (2.4.2)
|
129
|
+
|
130
|
+
PLATFORMS
|
131
|
+
ruby
|
132
|
+
|
133
|
+
DEPENDENCIES
|
134
|
+
activerecord (= 6.0.0)
|
135
|
+
appraisal
|
136
|
+
bundler (~> 2.0)
|
137
|
+
combustion (~> 1.3)
|
138
|
+
database_cleaner (~> 1.7)
|
139
|
+
pry
|
140
|
+
rake (~> 13.0)
|
141
|
+
rspec (~> 3.0)
|
142
|
+
rubocop-rspec (~> 1.33)
|
143
|
+
scenic (~> 1.5)
|
144
|
+
simplecov (~> 0.16)
|
145
|
+
table_saw!
|
146
|
+
|
147
|
+
BUNDLED WITH
|
148
|
+
2.1.4
|
@@ -0,0 +1,147 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
table_saw (2.7.0)
|
5
|
+
activerecord (>= 5.2)
|
6
|
+
pg
|
7
|
+
thor
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actionpack (6.1.0)
|
13
|
+
actionview (= 6.1.0)
|
14
|
+
activesupport (= 6.1.0)
|
15
|
+
rack (~> 2.0, >= 2.0.9)
|
16
|
+
rack-test (>= 0.6.3)
|
17
|
+
rails-dom-testing (~> 2.0)
|
18
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
+
actionview (6.1.0)
|
20
|
+
activesupport (= 6.1.0)
|
21
|
+
builder (~> 3.1)
|
22
|
+
erubi (~> 1.4)
|
23
|
+
rails-dom-testing (~> 2.0)
|
24
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
+
activemodel (6.1.0)
|
26
|
+
activesupport (= 6.1.0)
|
27
|
+
activerecord (6.1.0)
|
28
|
+
activemodel (= 6.1.0)
|
29
|
+
activesupport (= 6.1.0)
|
30
|
+
activesupport (6.1.0)
|
31
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
|
+
i18n (>= 1.6, < 2)
|
33
|
+
minitest (>= 5.1)
|
34
|
+
tzinfo (~> 2.0)
|
35
|
+
zeitwerk (~> 2.3)
|
36
|
+
appraisal (2.3.0)
|
37
|
+
bundler
|
38
|
+
rake
|
39
|
+
thor (>= 0.14.0)
|
40
|
+
ast (2.4.1)
|
41
|
+
builder (3.2.4)
|
42
|
+
coderay (1.1.3)
|
43
|
+
combustion (1.3.1)
|
44
|
+
activesupport (>= 3.0.0)
|
45
|
+
railties (>= 3.0.0)
|
46
|
+
thor (>= 0.14.6)
|
47
|
+
concurrent-ruby (1.1.7)
|
48
|
+
crass (1.0.6)
|
49
|
+
database_cleaner (1.8.5)
|
50
|
+
diff-lcs (1.4.4)
|
51
|
+
docile (1.3.2)
|
52
|
+
erubi (1.10.0)
|
53
|
+
i18n (1.8.5)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
loofah (2.8.0)
|
56
|
+
crass (~> 1.0.2)
|
57
|
+
nokogiri (>= 1.5.9)
|
58
|
+
method_source (1.0.0)
|
59
|
+
mini_portile2 (2.4.0)
|
60
|
+
minitest (5.14.2)
|
61
|
+
nokogiri (1.10.10)
|
62
|
+
mini_portile2 (~> 2.4.0)
|
63
|
+
parallel (1.20.1)
|
64
|
+
parser (2.7.2.0)
|
65
|
+
ast (~> 2.4.1)
|
66
|
+
pg (1.2.3)
|
67
|
+
pry (0.13.1)
|
68
|
+
coderay (~> 1.1)
|
69
|
+
method_source (~> 1.0)
|
70
|
+
rack (2.2.3)
|
71
|
+
rack-test (1.1.0)
|
72
|
+
rack (>= 1.0, < 3)
|
73
|
+
rails-dom-testing (2.0.3)
|
74
|
+
activesupport (>= 4.2.0)
|
75
|
+
nokogiri (>= 1.6)
|
76
|
+
rails-html-sanitizer (1.3.0)
|
77
|
+
loofah (~> 2.3)
|
78
|
+
railties (6.1.0)
|
79
|
+
actionpack (= 6.1.0)
|
80
|
+
activesupport (= 6.1.0)
|
81
|
+
method_source
|
82
|
+
rake (>= 0.8.7)
|
83
|
+
thor (~> 1.0)
|
84
|
+
rainbow (3.0.0)
|
85
|
+
rake (13.0.1)
|
86
|
+
regexp_parser (2.0.0)
|
87
|
+
rexml (3.2.4)
|
88
|
+
rspec (3.9.0)
|
89
|
+
rspec-core (~> 3.9.0)
|
90
|
+
rspec-expectations (~> 3.9.0)
|
91
|
+
rspec-mocks (~> 3.9.0)
|
92
|
+
rspec-core (3.9.3)
|
93
|
+
rspec-support (~> 3.9.3)
|
94
|
+
rspec-expectations (3.9.4)
|
95
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
+
rspec-support (~> 3.9.0)
|
97
|
+
rspec-mocks (3.9.1)
|
98
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
+
rspec-support (~> 3.9.0)
|
100
|
+
rspec-support (3.9.4)
|
101
|
+
rubocop (0.93.1)
|
102
|
+
parallel (~> 1.10)
|
103
|
+
parser (>= 2.7.1.5)
|
104
|
+
rainbow (>= 2.2.2, < 4.0)
|
105
|
+
regexp_parser (>= 1.8)
|
106
|
+
rexml
|
107
|
+
rubocop-ast (>= 0.6.0)
|
108
|
+
ruby-progressbar (~> 1.7)
|
109
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
110
|
+
rubocop-ast (1.3.0)
|
111
|
+
parser (>= 2.7.1.5)
|
112
|
+
rubocop-rspec (1.44.1)
|
113
|
+
rubocop (~> 0.87)
|
114
|
+
rubocop-ast (>= 0.7.1)
|
115
|
+
ruby-progressbar (1.10.1)
|
116
|
+
scenic (1.5.2)
|
117
|
+
activerecord (>= 4.0.0)
|
118
|
+
railties (>= 4.0.0)
|
119
|
+
simplecov (0.19.1)
|
120
|
+
docile (~> 1.1)
|
121
|
+
simplecov-html (~> 0.11)
|
122
|
+
simplecov-html (0.12.3)
|
123
|
+
thor (1.0.1)
|
124
|
+
tzinfo (2.0.3)
|
125
|
+
concurrent-ruby (~> 1.0)
|
126
|
+
unicode-display_width (1.7.0)
|
127
|
+
zeitwerk (2.4.2)
|
128
|
+
|
129
|
+
PLATFORMS
|
130
|
+
ruby
|
131
|
+
|
132
|
+
DEPENDENCIES
|
133
|
+
activerecord (= 6.1.0)
|
134
|
+
appraisal
|
135
|
+
bundler (~> 2.0)
|
136
|
+
combustion (~> 1.3)
|
137
|
+
database_cleaner (~> 1.7)
|
138
|
+
pry
|
139
|
+
rake (~> 13.0)
|
140
|
+
rspec (~> 3.0)
|
141
|
+
rubocop-rspec (~> 1.33)
|
142
|
+
scenic (~> 1.5)
|
143
|
+
simplecov (~> 0.16)
|
144
|
+
table_saw!
|
145
|
+
|
146
|
+
BUNDLED WITH
|
147
|
+
2.1.4
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TableSaw
|
4
|
+
class Associations
|
5
|
+
attr_reader :manifest
|
6
|
+
|
7
|
+
def initialize(manifest)
|
8
|
+
@manifest = manifest
|
9
|
+
end
|
10
|
+
|
11
|
+
def belongs_to
|
12
|
+
@belongs_to ||= foreign_keys.each_with_object(Hash.new { |h, k| h[k] = Set.new }) do |fk, memo|
|
13
|
+
memo[fk.from_table].add(fk)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def has_many
|
18
|
+
@has_many ||= foreign_keys.each_with_object(Hash.new { |h, k| h[k] = Set.new }) do |fk, memo|
|
19
|
+
memo[fk.to_table].add(fk)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def foreign_keys
|
26
|
+
@foreign_keys ||= manifest_foreign_keys + schema_foreign_keys
|
27
|
+
end
|
28
|
+
|
29
|
+
def manifest_foreign_keys
|
30
|
+
manifest.foreign_keys.map do |fk|
|
31
|
+
TableSaw::ForeignKey.new(from_table: fk['from_table'], from_column: fk['from_column'],
|
32
|
+
to_table: fk['to_table'], to_column: fk['to_column'])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def schema_foreign_keys
|
37
|
+
TableSaw.information_schema.foreign_key_relationships.foreign_keys
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -3,42 +3,46 @@
|
|
3
3
|
module TableSaw
|
4
4
|
module DependencyGraph
|
5
5
|
class BelongsToDirectives
|
6
|
-
|
6
|
+
QUERY = <<~SQL
|
7
|
+
select distinct %{column} from %{table_name} where %{clause} and %{column} is not null and %{polymorphic}
|
8
|
+
SQL
|
7
9
|
|
8
|
-
|
10
|
+
attr_reader :manifest, :directive
|
11
|
+
|
12
|
+
def initialize(manifest, directive)
|
13
|
+
@manifest = manifest
|
9
14
|
@directive = directive
|
10
15
|
end
|
11
16
|
|
12
17
|
def call
|
13
|
-
associations.map do |
|
14
|
-
TableSaw::DependencyGraph::AddDirective.new(to_table, ids: ids[
|
18
|
+
associations.map do |fk|
|
19
|
+
TableSaw::DependencyGraph::AddDirective.new(fk.to_table, ids: ids[fk.column.primary_key],
|
20
|
+
partial: directive.partial?)
|
15
21
|
end
|
16
22
|
end
|
17
23
|
|
18
24
|
private
|
19
25
|
|
20
26
|
def associations
|
21
|
-
|
27
|
+
manifest.associations.belongs_to.fetch(directive.table_name, Set.new)
|
22
28
|
end
|
23
29
|
|
24
30
|
def ids
|
25
|
-
@ids ||= associations.
|
26
|
-
memo[column] = query_result(
|
31
|
+
@ids ||= associations.each_with_object({}) do |fk, memo|
|
32
|
+
memo[fk.column.primary_key] = query_result(fk).map { |row| row[fk.column.primary_key] }
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
30
36
|
# rubocop:disable Metrics/AbcSize
|
31
|
-
def query_result(
|
37
|
+
def query_result(foreign_key)
|
32
38
|
return [] unless directive.selectable?
|
33
39
|
|
34
40
|
TableSaw::Connection.exec(
|
35
|
-
format(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
directive.ids).call
|
41
|
-
)
|
41
|
+
format(QUERY, column: foreign_key.column.primary_key, table_name: directive.table_name,
|
42
|
+
clause: TableSaw::Queries::SerializeSqlInClause.new(directive.table_name,
|
43
|
+
directive.primary_key,
|
44
|
+
directive.ids).call,
|
45
|
+
polymorphic: foreign_key.type_condition)
|
42
46
|
)
|
43
47
|
end
|
44
48
|
# rubocop:enable Metrics/AbcSize
|
@@ -3,6 +3,10 @@
|
|
3
3
|
module TableSaw
|
4
4
|
module DependencyGraph
|
5
5
|
class HasManyDirectives
|
6
|
+
QUERY = <<~SQL
|
7
|
+
select %{primary_key} from %{table} where %{clause} and %{polymorphic}
|
8
|
+
SQL
|
9
|
+
|
6
10
|
attr_reader :manifest, :directive
|
7
11
|
|
8
12
|
def initialize(manifest, directive)
|
@@ -11,10 +15,10 @@ module TableSaw
|
|
11
15
|
end
|
12
16
|
|
13
17
|
def call
|
14
|
-
valid_associations.map do |
|
18
|
+
valid_associations.map do |fk|
|
15
19
|
TableSaw::DependencyGraph::AddDirective.new(
|
16
|
-
|
17
|
-
ids: query_result(
|
20
|
+
fk.from_table,
|
21
|
+
ids: query_result(fk).map { |r| r[TableSaw.schema_cache.primary_keys(fk.from_table)] },
|
18
22
|
partial: directive.partial?
|
19
23
|
)
|
20
24
|
end
|
@@ -23,31 +27,32 @@ module TableSaw
|
|
23
27
|
private
|
24
28
|
|
25
29
|
def associations
|
26
|
-
|
30
|
+
manifest.associations.has_many.fetch(directive.table_name, Set.new)
|
27
31
|
end
|
28
32
|
|
29
33
|
# rubocop:disable Metrics/AbcSize
|
30
34
|
def valid_associations
|
31
|
-
associations.select do |
|
32
|
-
next false if directive.partial? && TableSaw.schema_cache.primary_keys(
|
33
|
-
next true if directive.has_many.include?(
|
35
|
+
associations.select do |fk|
|
36
|
+
next false if directive.partial? && TableSaw.schema_cache.primary_keys(fk.from_table).nil?
|
37
|
+
next true if directive.has_many.include?(fk.from_table)
|
34
38
|
|
35
|
-
manifest.has_many.fetch(directive.table_name, []).include?(
|
39
|
+
manifest.has_many.fetch(directive.table_name, []).include?(fk.from_table)
|
36
40
|
end
|
37
41
|
end
|
38
|
-
# rubocop:enable Metrics/AbcSize
|
39
42
|
|
40
|
-
def query_result(
|
43
|
+
def query_result(foreign_key)
|
41
44
|
return [] unless directive.selectable?
|
42
45
|
|
43
46
|
TableSaw::Connection.exec(
|
44
|
-
format(
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
format(QUERY, primary_key: TableSaw.schema_cache.primary_keys(foreign_key.from_table),
|
48
|
+
table: foreign_key.from_table,
|
49
|
+
clause: TableSaw::Queries::SerializeSqlInClause.new(foreign_key.from_table,
|
50
|
+
foreign_key.column.primary_key,
|
51
|
+
directive.ids).call,
|
52
|
+
polymorphic: foreign_key.type_condition)
|
49
53
|
)
|
50
54
|
end
|
55
|
+
# rubocop:enable Metrics/AbcSize
|
51
56
|
end
|
52
57
|
end
|
53
58
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TableSaw
|
4
|
+
class ForeignKey
|
5
|
+
class Column
|
6
|
+
REGEX = /(\w+)(?::(\w+)\((\w+)\))?/.freeze
|
7
|
+
|
8
|
+
attr_reader :value
|
9
|
+
|
10
|
+
def initialize(value)
|
11
|
+
@value = value
|
12
|
+
end
|
13
|
+
|
14
|
+
def primary_key
|
15
|
+
value[REGEX, 1]
|
16
|
+
end
|
17
|
+
|
18
|
+
def type_condition
|
19
|
+
polymorphic? ? "#{type_column} = '#{type_value}'" : '1 = 1'
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def type_column
|
25
|
+
value[REGEX, 2]
|
26
|
+
end
|
27
|
+
|
28
|
+
def type_value
|
29
|
+
value[REGEX, 3]
|
30
|
+
end
|
31
|
+
|
32
|
+
def polymorphic?
|
33
|
+
!(type_column.nil? || type_value.nil?)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
attr_reader :name, :from_table, :from_column, :to_table, :to_column
|
38
|
+
|
39
|
+
def initialize(name: nil, from_table:, from_column:, to_table:, to_column:)
|
40
|
+
@name = name
|
41
|
+
@from_table = from_table
|
42
|
+
@from_column = from_column
|
43
|
+
@to_table = to_table
|
44
|
+
@to_column = to_column
|
45
|
+
end
|
46
|
+
|
47
|
+
def type_condition
|
48
|
+
@type_condition ||= column.type_condition
|
49
|
+
end
|
50
|
+
|
51
|
+
def column
|
52
|
+
@column ||= Column.new(from_column)
|
53
|
+
end
|
54
|
+
|
55
|
+
def eql?(other)
|
56
|
+
hash == other.hash
|
57
|
+
end
|
58
|
+
|
59
|
+
def hash
|
60
|
+
[from_table, from_column, to_table, to_column].hash
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -2,14 +2,10 @@
|
|
2
2
|
|
3
3
|
module TableSaw
|
4
4
|
class InformationSchema
|
5
|
-
|
6
|
-
|
7
|
-
foreign_key_relationships.public_send method_name
|
8
|
-
end
|
5
|
+
def constraint_names
|
6
|
+
foreign_key_relationships.constraint_names
|
9
7
|
end
|
10
8
|
|
11
|
-
private
|
12
|
-
|
13
9
|
def foreign_key_relationships
|
14
10
|
@foreign_key_relationships ||= TableSaw::Queries::ForeignKeyRelationships.new
|
15
11
|
end
|
data/lib/table_saw/manifest.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'yaml'
|
4
|
+
require 'table_saw/associations'
|
4
5
|
|
5
6
|
module TableSaw
|
6
7
|
class Manifest
|
@@ -58,5 +59,13 @@ module TableSaw
|
|
58
59
|
def has_many
|
59
60
|
@has_many ||= config.fetch('has_many', {})
|
60
61
|
end
|
62
|
+
|
63
|
+
def foreign_keys
|
64
|
+
@foreign_keys ||= config.fetch('foreign_keys', [])
|
65
|
+
end
|
66
|
+
|
67
|
+
def associations
|
68
|
+
@associations ||= TableSaw::Associations.new(self)
|
69
|
+
end
|
61
70
|
end
|
62
71
|
end
|
@@ -18,16 +18,17 @@ module TableSaw
|
|
18
18
|
|
19
19
|
def values
|
20
20
|
TableSaw.schema_cache.columns(statement.table_name).zip(row)
|
21
|
-
.map { |column, value|
|
21
|
+
.map { |column, value| quote_value(column, value) }
|
22
22
|
.join(', ')
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
TableSaw.schema_cache
|
25
|
+
def connection
|
26
|
+
TableSaw.schema_cache.connection
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
30
|
-
|
29
|
+
def quote_value(column, value)
|
30
|
+
type = connection.lookup_cast_type_from_column(column)
|
31
|
+
connection.quote(type.serialize(type.deserialize(value)))
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'table_saw/foreign_key'
|
4
|
+
require 'set'
|
5
|
+
|
3
6
|
module TableSaw
|
4
7
|
module Queries
|
5
8
|
class ForeignKeyRelationships
|
@@ -16,24 +19,20 @@ module TableSaw
|
|
16
19
|
where tc.constraint_type = 'FOREIGN KEY'
|
17
20
|
SQL
|
18
21
|
|
19
|
-
def belongs_to
|
20
|
-
@belongs_to ||= result.each_with_object(Hash.new { |h, k| h[k] = {} }) do |row, memo|
|
21
|
-
memo[row['from_table']][row['from_column']] = row['to_table']
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def has_many
|
26
|
-
@has_many ||= result.each_with_object(Hash.new { |h, k| h[k] = [] }) do |row, memo|
|
27
|
-
memo[row['to_table']].push([row['from_table'], row['from_column']])
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
22
|
def constraint_names
|
32
23
|
@constraint_names ||= result.each_with_object(Hash.new { |h, k| h[k] = [] }) do |row, memo|
|
33
24
|
memo[row['from_table']].push(row['constraint_name'])
|
34
25
|
end
|
35
26
|
end
|
36
27
|
|
28
|
+
def foreign_keys
|
29
|
+
@foreign_keys ||= result.map do |row|
|
30
|
+
TableSaw::ForeignKey.new(name: row['constraint_name'],
|
31
|
+
from_table: row['from_table'], from_column: row['from_column'],
|
32
|
+
to_table: row['to_table'], to_column: row['to_column'])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
37
36
|
private
|
38
37
|
|
39
38
|
def result
|
@@ -30,13 +30,19 @@ module TableSaw
|
|
30
30
|
TableSaw.schema_cache.columns(table_name).map(&:sql_type_metadata).map(&:sql_type).join(', ')
|
31
31
|
end
|
32
32
|
|
33
|
+
def column_names
|
34
|
+
TableSaw.schema_cache.columns(table_name)
|
35
|
+
.map { |column| TableSaw.schema_cache.connection.quote_column_name(column.name) }
|
36
|
+
.join(', ')
|
37
|
+
end
|
38
|
+
|
33
39
|
def values_clause
|
34
40
|
1.upto(TableSaw.schema_cache.columns(table_name).size).map { |i| "$#{i}" }.join(', ')
|
35
41
|
end
|
36
42
|
|
37
43
|
def prepare_statement
|
38
44
|
<<~SQL.squish
|
39
|
-
PREPARE #{name} (#{column_types}) AS INSERT INTO #{table_name} VALUES (#{values_clause})
|
45
|
+
PREPARE #{name} (#{column_types}) AS INSERT INTO #{table_name} (#{column_names}) VALUES (#{values_clause})
|
40
46
|
SQL
|
41
47
|
end
|
42
48
|
|
data/lib/table_saw/version.rb
CHANGED
data/table_saw.gemspec
CHANGED
@@ -28,10 +28,10 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency 'thor'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
|
-
spec.add_development_dependency 'combustion', '~> 1.
|
31
|
+
spec.add_development_dependency 'combustion', '~> 1.3'
|
32
32
|
spec.add_development_dependency 'database_cleaner', '~> 1.7'
|
33
33
|
spec.add_development_dependency 'pry'
|
34
|
-
spec.add_development_dependency 'rake', '~>
|
34
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
35
35
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
36
36
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.33'
|
37
37
|
spec.add_development_dependency 'scenic', '~> 1.5'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_saw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamed Asghari
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
75
|
+
version: '1.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: database_cleaner
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '13.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '13.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +178,7 @@ dependencies:
|
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0.16'
|
181
|
-
description:
|
181
|
+
description:
|
182
182
|
email:
|
183
183
|
- hasghari@gmail.com
|
184
184
|
executables:
|
@@ -186,12 +186,14 @@ executables:
|
|
186
186
|
extensions: []
|
187
187
|
extra_rdoc_files: []
|
188
188
|
files:
|
189
|
+
- ".github/workflows/ruby.yml"
|
189
190
|
- ".gitignore"
|
190
191
|
- ".rspec"
|
191
192
|
- ".rubocop.yml"
|
192
193
|
- ".ruby-gemset"
|
193
194
|
- ".ruby-version"
|
194
|
-
- ".
|
195
|
+
- ".tool-versions"
|
196
|
+
- Appraisals
|
195
197
|
- CODE_OF_CONDUCT.md
|
196
198
|
- Gemfile
|
197
199
|
- Gemfile.lock
|
@@ -201,7 +203,13 @@ files:
|
|
201
203
|
- bin/console
|
202
204
|
- bin/setup
|
203
205
|
- exe/table-saw
|
206
|
+
- gemfiles/.bundle/config
|
207
|
+
- gemfiles/activerecord_6.0.0.gemfile
|
208
|
+
- gemfiles/activerecord_6.0.0.gemfile.lock
|
209
|
+
- gemfiles/activerecord_6.1.0.gemfile
|
210
|
+
- gemfiles/activerecord_6.1.0.gemfile.lock
|
204
211
|
- lib/table_saw.rb
|
212
|
+
- lib/table_saw/associations.rb
|
205
213
|
- lib/table_saw/configuration.rb
|
206
214
|
- lib/table_saw/connection.rb
|
207
215
|
- lib/table_saw/create_dump_file.rb
|
@@ -211,6 +219,7 @@ files:
|
|
211
219
|
- lib/table_saw/dependency_graph/build.rb
|
212
220
|
- lib/table_saw/dependency_graph/dump_table.rb
|
213
221
|
- lib/table_saw/dependency_graph/has_many_directives.rb
|
222
|
+
- lib/table_saw/foreign_key.rb
|
214
223
|
- lib/table_saw/formats.rb
|
215
224
|
- lib/table_saw/formats/base.rb
|
216
225
|
- lib/table_saw/formats/copy.rb
|
@@ -230,7 +239,7 @@ homepage: https://github.com/hasghari/table_saw
|
|
230
239
|
licenses:
|
231
240
|
- MIT
|
232
241
|
metadata: {}
|
233
|
-
post_install_message:
|
242
|
+
post_install_message:
|
234
243
|
rdoc_options: []
|
235
244
|
require_paths:
|
236
245
|
- lib
|
@@ -245,8 +254,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
254
|
- !ruby/object:Gem::Version
|
246
255
|
version: '0'
|
247
256
|
requirements: []
|
248
|
-
rubygems_version: 3.
|
249
|
-
signing_key:
|
257
|
+
rubygems_version: 3.1.4
|
258
|
+
signing_key:
|
250
259
|
specification_version: 4
|
251
260
|
summary: Create a postgres dump file from a subset of tables
|
252
261
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sudo: false
|
3
|
-
env:
|
4
|
-
global:
|
5
|
-
- CC_TEST_REPORTER_ID=5432d4e95a7749f237cf9e659c44ba28c5c91fa65436b15c5bc849d6d9ebc049
|
6
|
-
language: ruby
|
7
|
-
cache: bundler
|
8
|
-
rvm:
|
9
|
-
- 2.5.5
|
10
|
-
- 2.6.3
|
11
|
-
before_install: gem install bundler -v 2.0.1
|
12
|
-
before_script:
|
13
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
14
|
-
- chmod +x ./cc-test-reporter
|
15
|
-
- ./cc-test-reporter before-build
|
16
|
-
script:
|
17
|
-
- bundle exec rspec
|
18
|
-
after_script:
|
19
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
20
|
-
addons:
|
21
|
-
postgresql: "9.6"
|
22
|
-
services:
|
23
|
-
- postgresql
|