arel_toolkit 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +3 -0
- data/.gitignore +3 -1
- data/.rubocop.yml +1 -0
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/CHANGELOG.md +17 -3
- data/Gemfile.lock +126 -78
- data/README.md +7 -1
- data/arel_toolkit.gemspec +3 -5
- data/bin/console +2 -1
- data/bin/setup +23 -2
- data/docker-compose.yml +11 -0
- data/gemfiles/active_record_6.gemfile +3 -3
- data/gemfiles/active_record_6.gemfile.lock +9 -7
- data/gemfiles/arel_gems.gemfile.lock +9 -7
- data/gemfiles/default.gemfile.lock +9 -7
- data/lib/arel/enhance/node.rb +18 -12
- data/lib/arel/extensions/conflict.rb +3 -3
- data/lib/arel/extensions/infer.rb +2 -2
- data/lib/arel/extensions/insert_statement.rb +3 -3
- data/lib/arel/extensions/transaction.rb +9 -9
- data/lib/arel/sql_to_arel/pg_query_visitor.rb +430 -521
- data/lib/arel/sql_to_arel/pg_query_visitor/frame_options.rb +37 -5
- data/lib/arel/transformer/prefix_schema_name.rb +5 -3
- data/lib/arel_toolkit/version.rb +1 -1
- metadata +17 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e85f00fe708ffd879f590ca295d142d1f3cfa600455bd470cb92d167e95bf838
|
4
|
+
data.tar.gz: 457b2e9b32edc91701ccb18605422581ee2413a53e7552ed77016d4de8f1edf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a6e1f095fda8a0f1c0bdd59996610ea3f4547a9abff88ba716a06dcb4beea86c66e5da6ba824eb3eae2ae9b63a049c45a4ec93e5ef4885039b9bc90651cb4d9
|
7
|
+
data.tar.gz: ce81c70c0ee865f421cbc3be78fcc3b3fd31464ad836aed8f8f4b67e37b7092c0533cc5e2e899fbcab700fe7fb916c01ec919716c2fcd50f5605d3a148167e2d
|
data/.github/workflows/test.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.9
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v0.4.6](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.6) (2021-07-29)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.5...v0.4.6)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Use GitHub actions instead of TravisCI [\#137](https://github.com/mvgijssel/arel_toolkit/issues/137)
|
10
|
+
- Bump addressable from 2.7.0 to 2.8.0 [\#183](https://github.com/mvgijssel/arel_toolkit/pull/183) ([dependabot[bot]](https://github.com/apps/dependabot))
|
11
|
+
- Upgrade pg\_query to 2.0 [\#175](https://github.com/mvgijssel/arel_toolkit/pull/175) ([DeRRudi77](https://github.com/DeRRudi77))
|
12
|
+
|
13
|
+
**Fixed bugs:**
|
14
|
+
|
15
|
+
- Improve local development experience [\#184](https://github.com/mvgijssel/arel_toolkit/pull/184) ([mvgijssel](https://github.com/mvgijssel))
|
16
|
+
|
3
17
|
## [v0.4.5](https://github.com/mvgijssel/arel_toolkit/tree/v0.4.5) (2021-07-08)
|
4
18
|
|
5
19
|
[Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/v0.4.4...v0.4.5)
|
@@ -57,7 +71,7 @@
|
|
57
71
|
- Create a transformer that replaces a table reference with a subquery [\#141](https://github.com/mvgijssel/arel_toolkit/issues/141)
|
58
72
|
- Same signature for all middleware helpers [\#135](https://github.com/mvgijssel/arel_toolkit/issues/135)
|
59
73
|
- Instantiate PG::Result object instead of duck typed object [\#130](https://github.com/mvgijssel/arel_toolkit/issues/130)
|
60
|
-
- Add `
|
74
|
+
- Add `to_sql` to Arel.middleware which prints the sql after middleware processing [\#127](https://github.com/mvgijssel/arel_toolkit/issues/127)
|
61
75
|
- Extend Middleware to include the response from the database [\#126](https://github.com/mvgijssel/arel_toolkit/issues/126)
|
62
76
|
- Extend AddSchemaToTable to support multiple schemas and regclass typecasts [\#124](https://github.com/mvgijssel/arel_toolkit/issues/124)
|
63
77
|
- Optional context argument for Arel middleware [\#110](https://github.com/mvgijssel/arel_toolkit/issues/110)
|
@@ -123,7 +137,7 @@
|
|
123
137
|
|
124
138
|
## [v0.2.0](https://github.com/mvgijssel/arel_toolkit/tree/v0.2.0) (2019-05-30)
|
125
139
|
|
126
|
-
[Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/
|
140
|
+
[Full Changelog](https://github.com/mvgijssel/arel_toolkit/compare/6507f4849d752353a23e9c14b73e4759b370ada9...v0.2.0)
|
127
141
|
|
128
142
|
**Implemented enhancements:**
|
129
143
|
|
@@ -155,4 +169,4 @@
|
|
155
169
|
|
156
170
|
|
157
171
|
|
158
|
-
\* *This Changelog was automatically generated
|
172
|
+
\* *This Changelog was automatically generated by [github_changelog_generator] (https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile.lock
CHANGED
@@ -1,60 +1,98 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
arel_toolkit (0.4.
|
5
|
-
activerecord
|
4
|
+
arel_toolkit (0.4.6)
|
5
|
+
activerecord (>= 5.0.0, < 6.0.4)
|
6
6
|
pg (~> 1.1.4)
|
7
|
-
pg_query (~> 1
|
7
|
+
pg_query (~> 2.1)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (6.
|
13
|
-
activesupport (= 6.
|
14
|
-
activerecord (6.
|
15
|
-
activemodel (= 6.
|
16
|
-
activesupport (= 6.
|
17
|
-
activesupport (6.
|
12
|
+
activemodel (6.0.3.7)
|
13
|
+
activesupport (= 6.0.3.7)
|
14
|
+
activerecord (6.0.3.7)
|
15
|
+
activemodel (= 6.0.3.7)
|
16
|
+
activesupport (= 6.0.3.7)
|
17
|
+
activesupport (6.0.3.7)
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
-
i18n (>=
|
20
|
-
minitest (
|
21
|
-
tzinfo (~>
|
22
|
-
zeitwerk (~> 2.
|
23
|
-
addressable (2.
|
19
|
+
i18n (>= 0.7, < 2)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
tzinfo (~> 1.1)
|
22
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
23
|
+
addressable (2.8.0)
|
24
24
|
public_suffix (>= 2.0.2, < 5.0)
|
25
25
|
ansi (1.5.0)
|
26
|
-
appraisal (2.
|
26
|
+
appraisal (2.4.1)
|
27
27
|
bundler
|
28
28
|
rake
|
29
29
|
thor (>= 0.14.0)
|
30
|
-
approvals (0.0.
|
31
|
-
nokogiri (~> 1.
|
32
|
-
thor (~> 0
|
33
|
-
ast (2.4.
|
34
|
-
|
30
|
+
approvals (0.0.25)
|
31
|
+
nokogiri (~> 1.8)
|
32
|
+
thor (~> 1.0)
|
33
|
+
ast (2.4.2)
|
34
|
+
async (1.29.1)
|
35
|
+
console (~> 1.10)
|
36
|
+
nio4r (~> 2.3)
|
37
|
+
timers (~> 4.1)
|
38
|
+
async-http (0.56.3)
|
39
|
+
async (~> 1.25)
|
40
|
+
async-io (~> 1.28)
|
41
|
+
async-pool (~> 0.2)
|
42
|
+
protocol-http (~> 0.22.0)
|
43
|
+
protocol-http1 (~> 0.14.0)
|
44
|
+
protocol-http2 (~> 0.14.0)
|
45
|
+
async-http-faraday (0.11.0)
|
46
|
+
async-http (~> 0.42)
|
47
|
+
faraday
|
48
|
+
async-io (1.32.1)
|
49
|
+
async (~> 1.14)
|
50
|
+
async-pool (0.3.7)
|
51
|
+
async (~> 1.25)
|
52
|
+
binding_of_caller (1.0.0)
|
35
53
|
debug_inspector (>= 0.0.1)
|
36
|
-
coderay (1.1.
|
37
|
-
concurrent-ruby (1.1.
|
54
|
+
coderay (1.1.3)
|
55
|
+
concurrent-ruby (1.1.9)
|
56
|
+
console (1.13.1)
|
57
|
+
fiber-local
|
38
58
|
database_cleaner (1.7.0)
|
39
|
-
debug_inspector (
|
40
|
-
diff-lcs (1.
|
41
|
-
docile (1.
|
42
|
-
dpl (1.10.
|
43
|
-
faraday (
|
59
|
+
debug_inspector (1.1.0)
|
60
|
+
diff-lcs (1.4.4)
|
61
|
+
docile (1.4.0)
|
62
|
+
dpl (1.10.16)
|
63
|
+
faraday (1.5.1)
|
64
|
+
faraday-em_http (~> 1.0)
|
65
|
+
faraday-em_synchrony (~> 1.0)
|
66
|
+
faraday-excon (~> 1.1)
|
67
|
+
faraday-httpclient (~> 1.0.1)
|
68
|
+
faraday-net_http (~> 1.0)
|
69
|
+
faraday-net_http_persistent (~> 1.1)
|
70
|
+
faraday-patron (~> 1.0)
|
44
71
|
multipart-post (>= 1.2, < 3)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
72
|
+
ruby2_keywords (>= 0.0.4)
|
73
|
+
faraday-em_http (1.0.0)
|
74
|
+
faraday-em_synchrony (1.0.0)
|
75
|
+
faraday-excon (1.1.0)
|
76
|
+
faraday-http-cache (2.2.0)
|
77
|
+
faraday (>= 0.8)
|
78
|
+
faraday-httpclient (1.0.1)
|
79
|
+
faraday-net_http (1.0.1)
|
80
|
+
faraday-net_http_persistent (1.2.0)
|
81
|
+
faraday-patron (1.0.0)
|
82
|
+
ffi (1.15.3)
|
83
|
+
fiber-local (1.0.0)
|
84
|
+
formatador (0.3.0)
|
85
|
+
github_changelog_generator (1.16.4)
|
50
86
|
activesupport
|
87
|
+
async (>= 1.25.0)
|
88
|
+
async-http-faraday
|
51
89
|
faraday-http-cache
|
52
90
|
multi_json
|
53
91
|
octokit (~> 4.6)
|
54
92
|
rainbow (>= 2.2.1)
|
55
93
|
rake (>= 10.0)
|
56
|
-
|
57
|
-
guard (2.
|
94
|
+
google-protobuf (3.17.3)
|
95
|
+
guard (2.17.0)
|
58
96
|
formatador (>= 0.2.4)
|
59
97
|
listen (>= 2.7, < 4.0)
|
60
98
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -75,76 +113,84 @@ GEM
|
|
75
113
|
guard (~> 2.0)
|
76
114
|
rubocop (~> 0.20)
|
77
115
|
hirb (0.7.3)
|
78
|
-
i18n (1.8.
|
116
|
+
i18n (1.8.10)
|
79
117
|
concurrent-ruby (~> 1.0)
|
80
118
|
interception (0.5)
|
81
|
-
jaro_winkler (1.5.
|
82
|
-
json (2.
|
83
|
-
listen (3.1
|
84
|
-
rb-fsevent (~> 0.
|
85
|
-
rb-inotify (~> 0.9, >= 0.9.
|
86
|
-
|
87
|
-
lumberjack (1.0.13)
|
119
|
+
jaro_winkler (1.5.4)
|
120
|
+
json (2.5.1)
|
121
|
+
listen (3.5.1)
|
122
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
123
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
124
|
+
lumberjack (1.2.8)
|
88
125
|
memory_profiler (0.9.14)
|
89
126
|
method_source (0.9.2)
|
90
127
|
mini_portile2 (2.5.3)
|
91
128
|
minitest (5.14.4)
|
92
|
-
multi_json (1.
|
129
|
+
multi_json (1.15.0)
|
93
130
|
multipart-post (2.1.1)
|
94
131
|
nenv (0.3.0)
|
132
|
+
nio4r (2.5.7)
|
95
133
|
nokogiri (1.11.7)
|
96
134
|
mini_portile2 (~> 2.5.0)
|
97
135
|
racc (~> 1.4)
|
98
|
-
notiffany (0.1.
|
136
|
+
notiffany (0.1.3)
|
99
137
|
nenv (~> 0.1)
|
100
138
|
shellany (~> 0.0)
|
101
|
-
octokit (4.
|
139
|
+
octokit (4.21.0)
|
140
|
+
faraday (>= 0.9)
|
102
141
|
sawyer (~> 0.8.0, >= 0.5.3)
|
103
|
-
parallel (1.
|
104
|
-
parser (
|
105
|
-
ast (~> 2.4.
|
142
|
+
parallel (1.20.1)
|
143
|
+
parser (3.0.2.0)
|
144
|
+
ast (~> 2.4.1)
|
106
145
|
pg (1.1.4)
|
107
|
-
pg_query (1.
|
146
|
+
pg_query (2.1.0)
|
147
|
+
google-protobuf (>= 3.17.1)
|
148
|
+
protocol-hpack (1.4.2)
|
149
|
+
protocol-http (0.22.5)
|
150
|
+
protocol-http1 (0.14.1)
|
151
|
+
protocol-http (~> 0.22)
|
152
|
+
protocol-http2 (0.14.2)
|
153
|
+
protocol-hpack (~> 1.4)
|
154
|
+
protocol-http (~> 0.18)
|
108
155
|
pry (0.12.2)
|
109
156
|
coderay (~> 1.1.0)
|
110
157
|
method_source (~> 0.9.0)
|
111
158
|
pry-alias (0.0.1)
|
112
159
|
binding_of_caller
|
113
160
|
pry
|
114
|
-
pry-doc (1.
|
161
|
+
pry-doc (1.1.0)
|
115
162
|
pry (~> 0.11)
|
116
163
|
yard (~> 0.9.11)
|
117
164
|
pry-nav (0.3.0)
|
118
165
|
pry (>= 0.9.10, < 0.13.0)
|
119
|
-
pry-rescue (1.5.
|
166
|
+
pry-rescue (1.5.2)
|
120
167
|
interception (>= 0.5)
|
121
168
|
pry (>= 0.12.0)
|
122
169
|
pry-stack_explorer (0.4.9.3)
|
123
170
|
binding_of_caller (>= 0.7)
|
124
171
|
pry (>= 0.9.11)
|
125
|
-
public_suffix (4.0.
|
172
|
+
public_suffix (4.0.6)
|
126
173
|
racc (1.5.2)
|
127
174
|
rainbow (3.0.0)
|
128
|
-
rake (13.0.
|
129
|
-
rake-compiler (1.
|
175
|
+
rake (13.0.6)
|
176
|
+
rake-compiler (1.1.1)
|
130
177
|
rake
|
131
|
-
rb-fsevent (0.
|
132
|
-
rb-inotify (0.10.
|
178
|
+
rb-fsevent (0.11.0)
|
179
|
+
rb-inotify (0.10.1)
|
133
180
|
ffi (~> 1.0)
|
134
|
-
|
135
|
-
|
136
|
-
rspec-
|
137
|
-
rspec-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
rspec-expectations (3.8.3)
|
181
|
+
rspec (3.10.0)
|
182
|
+
rspec-core (~> 3.10.0)
|
183
|
+
rspec-expectations (~> 3.10.0)
|
184
|
+
rspec-mocks (~> 3.10.0)
|
185
|
+
rspec-core (3.10.1)
|
186
|
+
rspec-support (~> 3.10.0)
|
187
|
+
rspec-expectations (3.10.1)
|
142
188
|
diff-lcs (>= 1.2.0, < 2.0)
|
143
|
-
rspec-support (~> 3.
|
144
|
-
rspec-mocks (3.
|
189
|
+
rspec-support (~> 3.10.0)
|
190
|
+
rspec-mocks (3.10.2)
|
145
191
|
diff-lcs (>= 1.2.0, < 2.0)
|
146
|
-
rspec-support (~> 3.
|
147
|
-
rspec-support (3.
|
192
|
+
rspec-support (~> 3.10.0)
|
193
|
+
rspec-support (3.10.2)
|
148
194
|
rubocop (0.71.0)
|
149
195
|
jaro_winkler (~> 1.5.1)
|
150
196
|
parallel (~> 1.10)
|
@@ -152,8 +198,8 @@ GEM
|
|
152
198
|
rainbow (>= 2.2.2, < 4.0)
|
153
199
|
ruby-progressbar (~> 1.7)
|
154
200
|
unicode-display_width (>= 1.4.0, < 1.7)
|
155
|
-
ruby-progressbar (1.
|
156
|
-
|
201
|
+
ruby-progressbar (1.11.0)
|
202
|
+
ruby2_keywords (0.0.4)
|
157
203
|
sawyer (0.8.2)
|
158
204
|
addressable (>= 2.3.5)
|
159
205
|
faraday (> 0.8, < 2.0)
|
@@ -167,19 +213,21 @@ GEM
|
|
167
213
|
hirb
|
168
214
|
simplecov
|
169
215
|
simplecov-html (0.10.2)
|
170
|
-
stackprof (0.2.
|
171
|
-
thor (
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
216
|
+
stackprof (0.2.17)
|
217
|
+
thor (1.1.0)
|
218
|
+
thread_safe (0.3.6)
|
219
|
+
timers (4.3.3)
|
220
|
+
tzinfo (1.2.9)
|
221
|
+
thread_safe (~> 0.1)
|
222
|
+
unicode-display_width (1.6.1)
|
223
|
+
yard (0.9.26)
|
176
224
|
zeitwerk (2.4.2)
|
177
225
|
|
178
226
|
PLATFORMS
|
179
227
|
ruby
|
180
228
|
|
181
229
|
DEPENDENCIES
|
182
|
-
appraisal (~> 2.
|
230
|
+
appraisal (~> 2.4.1)
|
183
231
|
approvals (~> 0.0.24)
|
184
232
|
arel_toolkit!
|
185
233
|
bundler (~> 2.0)
|
@@ -206,4 +254,4 @@ DEPENDENCIES
|
|
206
254
|
stackprof (~> 0.2)
|
207
255
|
|
208
256
|
BUNDLED WITH
|
209
|
-
2.2.
|
257
|
+
2.2.23
|
data/README.md
CHANGED
@@ -143,7 +143,13 @@ This gem aims to have full support for PostgreSQL's SQL. In order to do so, it n
|
|
143
143
|
|
144
144
|
## Development
|
145
145
|
|
146
|
-
|
146
|
+
1. Check out the repo
|
147
|
+
1. Run `bin/setup` to install dependencies.
|
148
|
+
1. Start the postgres database `docker compose up`
|
149
|
+
1. Run `bundle exec rspec` to run the tests
|
150
|
+
1. Run `bundle exec appraisal rspec` to run the tests for the different gem sets
|
151
|
+
|
152
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`.
|
147
153
|
|
148
154
|
## Releasing
|
149
155
|
|
data/arel_toolkit.gemspec
CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
spec.extensions = ['ext/pg_result_init/extconf.rb']
|
27
27
|
|
28
|
-
spec.add_dependency 'activerecord'
|
28
|
+
spec.add_dependency 'activerecord', '>= 5.0.0', '< 6.0.4'
|
29
29
|
spec.add_dependency 'pg', '~> 1.1.4'
|
30
|
-
spec.add_dependency 'pg_query', '~> 1
|
30
|
+
spec.add_dependency 'pg_query', '~> 2.1'
|
31
31
|
|
32
32
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
33
33
|
spec.add_development_dependency 'dpl', '~> 1.10.11'
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency 'rake-compiler', '~> 1.0'
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.8'
|
38
38
|
spec.add_development_dependency 'approvals', '~> 0.0.24'
|
39
|
-
spec.add_development_dependency 'appraisal', '~> 2.
|
39
|
+
spec.add_development_dependency 'appraisal', '~> 2.4.1'
|
40
40
|
spec.add_development_dependency 'database_cleaner', '~> 1.7.0'
|
41
41
|
spec.add_development_dependency 'simplecov', '~> 0.16.1'
|
42
42
|
spec.add_development_dependency 'simplecov-console', '~> 0.4.2'
|
@@ -47,10 +47,8 @@ Gem::Specification.new do |spec|
|
|
47
47
|
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
48
48
|
spec.add_development_dependency 'guard-rubocop', '~> 1.3.0'
|
49
49
|
spec.add_development_dependency 'guard-rake', '~> 1.0.0'
|
50
|
-
|
51
50
|
spec.add_development_dependency 'stackprof', '~> 0.2'
|
52
51
|
spec.add_development_dependency 'memory_profiler', '~> 0.9'
|
53
|
-
|
54
52
|
spec.add_development_dependency 'pry'
|
55
53
|
spec.add_development_dependency 'pry-nav'
|
56
54
|
spec.add_development_dependency 'pry-doc'
|
data/bin/console
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'bundler/setup'
|
4
|
+
require 'pry'
|
5
|
+
|
4
6
|
require 'arel_toolkit'
|
5
7
|
require_relative '../spec/support/active_record'
|
6
8
|
|
@@ -8,5 +10,4 @@ require_relative '../spec/support/active_record'
|
|
8
10
|
# with your gem easier. You can also use a different console, if you like.
|
9
11
|
|
10
12
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
require 'pry'
|
12
13
|
Pry.start
|