arfi 0.5.1 → 1.0.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.
- checksums.yaml +4 -4
- data/.env.sample +2 -0
- data/.rspec +1 -0
- data/.rubocop.yml +8 -1
- data/.rubocop_todo.yml +12 -0
- data/CHANGELOG.md +94 -0
- data/CODE_OF_CONDUCT.md +5 -1
- data/CONTRIBUTING.md +26 -0
- data/README.md +327 -118
- data/SECURITY.md +17 -0
- data/Steepfile +1 -29
- data/compose.yml +33 -0
- data/docscribe.yml +92 -0
- data/gemfiles/rails_6_0.gemfile +11 -0
- data/gemfiles/rails_6_1.gemfile +11 -0
- data/gemfiles/rails_7_0.gemfile +9 -0
- data/gemfiles/rails_7_1.gemfile +10 -0
- data/gemfiles/rails_7_2.gemfile +10 -0
- data/gemfiles/rails_8_0.gemfile +10 -0
- data/gemfiles/rails_8_1.gemfile +10 -0
- data/lib/arfi/cli.rb +24 -9
- data/lib/arfi/commands/f_idx.rb +5 -230
- data/lib/arfi/commands/functions.rb +128 -0
- data/lib/arfi/commands/functions_candidates.rb +133 -0
- data/lib/arfi/commands/functions_creation.rb +157 -0
- data/lib/arfi/commands/functions_helpers.rb +181 -0
- data/lib/arfi/commands/functions_paths.rb +131 -0
- data/lib/arfi/commands/functions_rendering.rb +137 -0
- data/lib/arfi/commands/init.rb +88 -0
- data/lib/arfi/commands/project.rb +5 -51
- data/lib/arfi/errors.rb +15 -3
- data/lib/arfi/extensions/active_record/base.rb +33 -23
- data/lib/arfi/extensions/active_record/connection_adapters/postgresql/database_statements.rb +159 -24
- data/lib/arfi/sql_function_loader.rb +289 -90
- data/lib/arfi/tasks/db.rake +60 -18
- data/lib/arfi/version.rb +1 -1
- data/lib/arfi.rb +2 -0
- data/rbs_collection.lock.yaml +93 -61
- data/sig/compat/active_record_base_compat.rbs +17 -0
- data/sig/compat/thor_dsl.rbs +8 -0
- data/sig/lib/arfi/commands/f_idx.rbs +5 -103
- data/sig/lib/arfi/commands/functions.rbs +99 -0
- data/sig/lib/arfi/commands/functions_candidates.rbs +25 -0
- data/sig/lib/arfi/commands/functions_creation.rbs +29 -0
- data/sig/lib/arfi/commands/functions_helpers.rbs +41 -0
- data/sig/lib/arfi/commands/functions_paths.rbs +25 -0
- data/sig/lib/arfi/commands/functions_rendering.rbs +25 -0
- data/sig/lib/arfi/commands/init.rbs +22 -0
- data/sig/lib/arfi/commands/project.rbs +5 -24
- data/sig/lib/arfi/extensions/active_record/base.rbs +5 -10
- data/sig/lib/arfi/extensions/active_record/connection_adapters/postgresql/database_statements.rbs +28 -0
- data/sig/lib/arfi/sql_function_loader.rbs +45 -87
- data/sig/lib/arfi/tasks/db.rbs +3 -0
- data/sig/lib/arfi/version.rbs +1 -1
- metadata +125 -14
data/rbs_collection.lock.yaml
CHANGED
|
@@ -6,7 +6,7 @@ gems:
|
|
|
6
6
|
source:
|
|
7
7
|
type: git
|
|
8
8
|
name: ruby/gem_rbs_collection
|
|
9
|
-
revision:
|
|
9
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
11
11
|
repo_dir: gems
|
|
12
12
|
- name: actionmailer
|
|
@@ -14,7 +14,7 @@ gems:
|
|
|
14
14
|
source:
|
|
15
15
|
type: git
|
|
16
16
|
name: ruby/gem_rbs_collection
|
|
17
|
-
revision:
|
|
17
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
18
18
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
19
19
|
repo_dir: gems
|
|
20
20
|
- name: actionpack
|
|
@@ -22,7 +22,7 @@ gems:
|
|
|
22
22
|
source:
|
|
23
23
|
type: git
|
|
24
24
|
name: ruby/gem_rbs_collection
|
|
25
|
-
revision:
|
|
25
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
26
26
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
27
27
|
repo_dir: gems
|
|
28
28
|
- name: actiontext
|
|
@@ -30,7 +30,7 @@ gems:
|
|
|
30
30
|
source:
|
|
31
31
|
type: git
|
|
32
32
|
name: ruby/gem_rbs_collection
|
|
33
|
-
revision:
|
|
33
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
34
34
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
35
35
|
repo_dir: gems
|
|
36
36
|
- name: actionview
|
|
@@ -38,7 +38,7 @@ gems:
|
|
|
38
38
|
source:
|
|
39
39
|
type: git
|
|
40
40
|
name: ruby/gem_rbs_collection
|
|
41
|
-
revision:
|
|
41
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
42
42
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
43
43
|
repo_dir: gems
|
|
44
44
|
- name: activejob
|
|
@@ -46,7 +46,7 @@ gems:
|
|
|
46
46
|
source:
|
|
47
47
|
type: git
|
|
48
48
|
name: ruby/gem_rbs_collection
|
|
49
|
-
revision:
|
|
49
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
50
50
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
51
51
|
repo_dir: gems
|
|
52
52
|
- name: activemodel
|
|
@@ -54,7 +54,7 @@ gems:
|
|
|
54
54
|
source:
|
|
55
55
|
type: git
|
|
56
56
|
name: ruby/gem_rbs_collection
|
|
57
|
-
revision:
|
|
57
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
58
58
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
59
59
|
repo_dir: gems
|
|
60
60
|
- name: activerecord
|
|
@@ -62,7 +62,7 @@ gems:
|
|
|
62
62
|
source:
|
|
63
63
|
type: git
|
|
64
64
|
name: ruby/gem_rbs_collection
|
|
65
|
-
revision:
|
|
65
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
66
66
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
67
67
|
repo_dir: gems
|
|
68
68
|
- name: activestorage
|
|
@@ -70,7 +70,7 @@ gems:
|
|
|
70
70
|
source:
|
|
71
71
|
type: git
|
|
72
72
|
name: ruby/gem_rbs_collection
|
|
73
|
-
revision:
|
|
73
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
74
74
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
75
75
|
repo_dir: gems
|
|
76
76
|
- name: activesupport
|
|
@@ -78,7 +78,7 @@ gems:
|
|
|
78
78
|
source:
|
|
79
79
|
type: git
|
|
80
80
|
name: ruby/gem_rbs_collection
|
|
81
|
-
revision:
|
|
81
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
82
82
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
83
83
|
repo_dir: gems
|
|
84
84
|
- name: ast
|
|
@@ -86,39 +86,35 @@ gems:
|
|
|
86
86
|
source:
|
|
87
87
|
type: git
|
|
88
88
|
name: ruby/gem_rbs_collection
|
|
89
|
-
revision:
|
|
89
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
90
90
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
91
91
|
repo_dir: gems
|
|
92
92
|
- name: base64
|
|
93
|
-
version:
|
|
93
|
+
version: 0.3.0
|
|
94
|
+
source:
|
|
95
|
+
type: rubygems
|
|
96
|
+
- name: bigdecimal
|
|
97
|
+
version: '4.0'
|
|
94
98
|
source:
|
|
95
99
|
type: git
|
|
96
100
|
name: ruby/gem_rbs_collection
|
|
97
|
-
revision:
|
|
101
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
98
102
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
99
103
|
repo_dir: gems
|
|
100
|
-
- name:
|
|
101
|
-
version: '0'
|
|
102
|
-
source:
|
|
103
|
-
type: stdlib
|
|
104
|
-
- name: bigdecimal
|
|
105
|
-
version: '3.1'
|
|
104
|
+
- name: cgi
|
|
105
|
+
version: '0.5'
|
|
106
106
|
source:
|
|
107
107
|
type: git
|
|
108
108
|
name: ruby/gem_rbs_collection
|
|
109
|
-
revision:
|
|
109
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
110
110
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
111
111
|
repo_dir: gems
|
|
112
|
-
- name: cgi
|
|
113
|
-
version: '0'
|
|
114
|
-
source:
|
|
115
|
-
type: stdlib
|
|
116
112
|
- name: concurrent-ruby
|
|
117
113
|
version: '1.1'
|
|
118
114
|
source:
|
|
119
115
|
type: git
|
|
120
116
|
name: ruby/gem_rbs_collection
|
|
121
|
-
revision:
|
|
117
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
122
118
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
123
119
|
repo_dir: gems
|
|
124
120
|
- name: connection_pool
|
|
@@ -126,7 +122,7 @@ gems:
|
|
|
126
122
|
source:
|
|
127
123
|
type: git
|
|
128
124
|
name: ruby/gem_rbs_collection
|
|
129
|
-
revision:
|
|
125
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
130
126
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
131
127
|
repo_dir: gems
|
|
132
128
|
- name: csv
|
|
@@ -134,13 +130,17 @@ gems:
|
|
|
134
130
|
source:
|
|
135
131
|
type: git
|
|
136
132
|
name: ruby/gem_rbs_collection
|
|
137
|
-
revision:
|
|
133
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
138
134
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
139
135
|
repo_dir: gems
|
|
140
136
|
- name: date
|
|
141
137
|
version: '0'
|
|
142
138
|
source:
|
|
143
139
|
type: stdlib
|
|
140
|
+
- name: dbm
|
|
141
|
+
version: '0'
|
|
142
|
+
source:
|
|
143
|
+
type: stdlib
|
|
144
144
|
- name: delegate
|
|
145
145
|
version: '0'
|
|
146
146
|
source:
|
|
@@ -150,7 +150,7 @@ gems:
|
|
|
150
150
|
source:
|
|
151
151
|
type: git
|
|
152
152
|
name: ruby/gem_rbs_collection
|
|
153
|
-
revision:
|
|
153
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
154
154
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
155
155
|
repo_dir: gems
|
|
156
156
|
- name: digest
|
|
@@ -162,7 +162,7 @@ gems:
|
|
|
162
162
|
source:
|
|
163
163
|
type: stdlib
|
|
164
164
|
- name: ffi
|
|
165
|
-
version: 1.17.
|
|
165
|
+
version: 1.17.3
|
|
166
166
|
source:
|
|
167
167
|
type: rubygems
|
|
168
168
|
- name: fileutils
|
|
@@ -178,7 +178,7 @@ gems:
|
|
|
178
178
|
source:
|
|
179
179
|
type: git
|
|
180
180
|
name: ruby/gem_rbs_collection
|
|
181
|
-
revision:
|
|
181
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
182
182
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
183
183
|
repo_dir: gems
|
|
184
184
|
- name: i18n
|
|
@@ -186,7 +186,7 @@ gems:
|
|
|
186
186
|
source:
|
|
187
187
|
type: git
|
|
188
188
|
name: ruby/gem_rbs_collection
|
|
189
|
-
revision:
|
|
189
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
190
190
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
191
191
|
repo_dir: gems
|
|
192
192
|
- name: io-console
|
|
@@ -197,12 +197,20 @@ gems:
|
|
|
197
197
|
version: '0'
|
|
198
198
|
source:
|
|
199
199
|
type: stdlib
|
|
200
|
+
- name: lint_roller
|
|
201
|
+
version: '1.1'
|
|
202
|
+
source:
|
|
203
|
+
type: git
|
|
204
|
+
name: ruby/gem_rbs_collection
|
|
205
|
+
revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e
|
|
206
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
207
|
+
repo_dir: gems
|
|
200
208
|
- name: listen
|
|
201
209
|
version: '3.9'
|
|
202
210
|
source:
|
|
203
211
|
type: git
|
|
204
212
|
name: ruby/gem_rbs_collection
|
|
205
|
-
revision:
|
|
213
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
206
214
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
207
215
|
repo_dir: gems
|
|
208
216
|
- name: logger
|
|
@@ -214,7 +222,7 @@ gems:
|
|
|
214
222
|
source:
|
|
215
223
|
type: git
|
|
216
224
|
name: ruby/gem_rbs_collection
|
|
217
|
-
revision:
|
|
225
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
218
226
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
219
227
|
repo_dir: gems
|
|
220
228
|
- name: marcel
|
|
@@ -222,7 +230,7 @@ gems:
|
|
|
222
230
|
source:
|
|
223
231
|
type: git
|
|
224
232
|
name: ruby/gem_rbs_collection
|
|
225
|
-
revision:
|
|
233
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
226
234
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
227
235
|
repo_dir: gems
|
|
228
236
|
- name: mini_mime
|
|
@@ -230,7 +238,7 @@ gems:
|
|
|
230
238
|
source:
|
|
231
239
|
type: git
|
|
232
240
|
name: ruby/gem_rbs_collection
|
|
233
|
-
revision:
|
|
241
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
234
242
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
235
243
|
repo_dir: gems
|
|
236
244
|
- name: minitest
|
|
@@ -238,7 +246,7 @@ gems:
|
|
|
238
246
|
source:
|
|
239
247
|
type: git
|
|
240
248
|
name: ruby/gem_rbs_collection
|
|
241
|
-
revision:
|
|
249
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
242
250
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
243
251
|
repo_dir: gems
|
|
244
252
|
- name: monitor
|
|
@@ -249,6 +257,14 @@ gems:
|
|
|
249
257
|
version: 0.3.0
|
|
250
258
|
source:
|
|
251
259
|
type: rubygems
|
|
260
|
+
- name: mysql2
|
|
261
|
+
version: '0.5'
|
|
262
|
+
source:
|
|
263
|
+
type: git
|
|
264
|
+
name: ruby/gem_rbs_collection
|
|
265
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
266
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
267
|
+
repo_dir: gems
|
|
252
268
|
- name: net-protocol
|
|
253
269
|
version: '0'
|
|
254
270
|
source:
|
|
@@ -258,7 +274,7 @@ gems:
|
|
|
258
274
|
source:
|
|
259
275
|
type: git
|
|
260
276
|
name: ruby/gem_rbs_collection
|
|
261
|
-
revision:
|
|
277
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
262
278
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
263
279
|
repo_dir: gems
|
|
264
280
|
- name: nokogiri
|
|
@@ -266,7 +282,7 @@ gems:
|
|
|
266
282
|
source:
|
|
267
283
|
type: git
|
|
268
284
|
name: ruby/gem_rbs_collection
|
|
269
|
-
revision:
|
|
285
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
270
286
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
271
287
|
repo_dir: gems
|
|
272
288
|
- name: openssl
|
|
@@ -282,7 +298,7 @@ gems:
|
|
|
282
298
|
source:
|
|
283
299
|
type: git
|
|
284
300
|
name: ruby/gem_rbs_collection
|
|
285
|
-
revision:
|
|
301
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
286
302
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
287
303
|
repo_dir: gems
|
|
288
304
|
- name: parser
|
|
@@ -290,13 +306,9 @@ gems:
|
|
|
290
306
|
source:
|
|
291
307
|
type: git
|
|
292
308
|
name: ruby/gem_rbs_collection
|
|
293
|
-
revision:
|
|
309
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
294
310
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
295
311
|
repo_dir: gems
|
|
296
|
-
- name: pathname
|
|
297
|
-
version: '0'
|
|
298
|
-
source:
|
|
299
|
-
type: stdlib
|
|
300
312
|
- name: pp
|
|
301
313
|
version: '0'
|
|
302
314
|
source:
|
|
@@ -306,15 +318,23 @@ gems:
|
|
|
306
318
|
source:
|
|
307
319
|
type: stdlib
|
|
308
320
|
- name: prism
|
|
309
|
-
version: 1.
|
|
321
|
+
version: 1.8.0
|
|
310
322
|
source:
|
|
311
323
|
type: rubygems
|
|
324
|
+
- name: pstore
|
|
325
|
+
version: '0'
|
|
326
|
+
source:
|
|
327
|
+
type: stdlib
|
|
328
|
+
- name: psych
|
|
329
|
+
version: '0'
|
|
330
|
+
source:
|
|
331
|
+
type: stdlib
|
|
312
332
|
- name: rack
|
|
313
333
|
version: '2.2'
|
|
314
334
|
source:
|
|
315
335
|
type: git
|
|
316
336
|
name: ruby/gem_rbs_collection
|
|
317
|
-
revision:
|
|
337
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
318
338
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
319
339
|
repo_dir: gems
|
|
320
340
|
- name: rails-dom-testing
|
|
@@ -322,7 +342,7 @@ gems:
|
|
|
322
342
|
source:
|
|
323
343
|
type: git
|
|
324
344
|
name: ruby/gem_rbs_collection
|
|
325
|
-
revision:
|
|
345
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
326
346
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
327
347
|
repo_dir: gems
|
|
328
348
|
- name: rails-html-sanitizer
|
|
@@ -330,7 +350,7 @@ gems:
|
|
|
330
350
|
source:
|
|
331
351
|
type: git
|
|
332
352
|
name: ruby/gem_rbs_collection
|
|
333
|
-
revision:
|
|
353
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
334
354
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
335
355
|
repo_dir: gems
|
|
336
356
|
- name: railties
|
|
@@ -338,7 +358,7 @@ gems:
|
|
|
338
358
|
source:
|
|
339
359
|
type: git
|
|
340
360
|
name: ruby/gem_rbs_collection
|
|
341
|
-
revision:
|
|
361
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
342
362
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
343
363
|
repo_dir: gems
|
|
344
364
|
- name: rainbow
|
|
@@ -346,7 +366,7 @@ gems:
|
|
|
346
366
|
source:
|
|
347
367
|
type: git
|
|
348
368
|
name: ruby/gem_rbs_collection
|
|
349
|
-
revision:
|
|
369
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
350
370
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
351
371
|
repo_dir: gems
|
|
352
372
|
- name: rake
|
|
@@ -354,11 +374,11 @@ gems:
|
|
|
354
374
|
source:
|
|
355
375
|
type: git
|
|
356
376
|
name: ruby/gem_rbs_collection
|
|
357
|
-
revision:
|
|
377
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
358
378
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
359
379
|
repo_dir: gems
|
|
360
380
|
- name: rbs
|
|
361
|
-
version: 3.
|
|
381
|
+
version: 3.10.2
|
|
362
382
|
source:
|
|
363
383
|
type: rubygems
|
|
364
384
|
- name: rdoc
|
|
@@ -370,29 +390,33 @@ gems:
|
|
|
370
390
|
source:
|
|
371
391
|
type: git
|
|
372
392
|
name: ruby/gem_rbs_collection
|
|
373
|
-
revision:
|
|
393
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
374
394
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
375
395
|
repo_dir: gems
|
|
376
|
-
- name:
|
|
377
|
-
version: 0
|
|
396
|
+
- name: ripper
|
|
397
|
+
version: '0'
|
|
378
398
|
source:
|
|
379
|
-
type:
|
|
399
|
+
type: stdlib
|
|
380
400
|
- name: rubocop
|
|
381
401
|
version: '1.57'
|
|
382
402
|
source:
|
|
383
403
|
type: git
|
|
384
404
|
name: ruby/gem_rbs_collection
|
|
385
|
-
revision:
|
|
405
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
386
406
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
387
407
|
repo_dir: gems
|
|
388
408
|
- name: rubocop-ast
|
|
389
|
-
version: '1.
|
|
409
|
+
version: '1.46'
|
|
390
410
|
source:
|
|
391
411
|
type: git
|
|
392
412
|
name: ruby/gem_rbs_collection
|
|
393
|
-
revision:
|
|
413
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
394
414
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
395
415
|
repo_dir: gems
|
|
416
|
+
- name: rubocop-sorted_methods_by_call
|
|
417
|
+
version: 1.2.3
|
|
418
|
+
source:
|
|
419
|
+
type: rubygems
|
|
396
420
|
- name: securerandom
|
|
397
421
|
version: '0'
|
|
398
422
|
source:
|
|
@@ -422,7 +446,7 @@ gems:
|
|
|
422
446
|
source:
|
|
423
447
|
type: git
|
|
424
448
|
name: ruby/gem_rbs_collection
|
|
425
|
-
revision:
|
|
449
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
426
450
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
427
451
|
repo_dir: gems
|
|
428
452
|
- name: time
|
|
@@ -442,11 +466,19 @@ gems:
|
|
|
442
466
|
source:
|
|
443
467
|
type: git
|
|
444
468
|
name: ruby/gem_rbs_collection
|
|
445
|
-
revision:
|
|
469
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
446
470
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
447
471
|
repo_dir: gems
|
|
448
472
|
- name: uri
|
|
449
473
|
version: '0'
|
|
450
474
|
source:
|
|
451
475
|
type: stdlib
|
|
476
|
+
- name: yard
|
|
477
|
+
version: '0.9'
|
|
478
|
+
source:
|
|
479
|
+
type: git
|
|
480
|
+
name: ruby/gem_rbs_collection
|
|
481
|
+
revision: d07edeb13c53de1c65b2bede98a720ac52d497a2
|
|
482
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
483
|
+
repo_dir: gems
|
|
452
484
|
gemfile_lock_path: Gemfile.lock
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module ActiveRecord
|
|
2
|
+
class Base
|
|
3
|
+
def self.connection_handler: () -> ::ActiveRecord::ConnectionAdapters::ConnectionHandler
|
|
4
|
+
|
|
5
|
+
def self.clear_active_connections!: () -> void
|
|
6
|
+
|
|
7
|
+
def self.configurations: () -> ::ActiveRecord::DatabaseConfigurations
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class DatabaseConfigurations::DatabaseConfig
|
|
11
|
+
def name: () -> ::String
|
|
12
|
+
|
|
13
|
+
def env_name: () -> ::String
|
|
14
|
+
|
|
15
|
+
def configuration_hash: () -> ::Hash[::Symbol | ::String, ::String | ::Integer | bool | nil]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -1,107 +1,9 @@
|
|
|
1
1
|
module Arfi
|
|
2
2
|
module Commands
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# This command is used to create the functional index.
|
|
9
|
-
#
|
|
10
|
-
# @example
|
|
11
|
-
# bundle exec arfi f_idx create some_function
|
|
12
|
-
# @param index_name [String] Name of the index.
|
|
13
|
-
# @return [void]
|
|
14
|
-
# @raise [Arfi::Errors::InvalidSchemaFormat] if ActiveRecord.schema_format is not :ruby
|
|
15
|
-
# @raise [Arfi::Errors::NoFunctionsDir] if there is no `db/functions` directory
|
|
16
|
-
# @see Arfi::Commands::FIdx#validate_schema_format!
|
|
17
|
-
def create: (string index_name) -> untyped
|
|
18
|
-
|
|
19
|
-
# +Arfi::Commands::FIdx#destroy+ -> void
|
|
20
|
-
#
|
|
21
|
-
# This command is used to delete the functional index.
|
|
22
|
-
#
|
|
23
|
-
# @example
|
|
24
|
-
# bundle exec arfi f_idx destroy some_function [revision index (just an integer, 1 is by default)]
|
|
25
|
-
# @param index_name [String] Name of the index.
|
|
26
|
-
# @return [void]
|
|
27
|
-
# @raise [Arfi::Errors::InvalidSchemaFormat] if ActiveRecord.schema_format is not :ruby
|
|
28
|
-
def destroy: (string index_name) -> untyped
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
# +Arfi::Commands::FIdx#build_from_file+ -> String
|
|
33
|
-
#
|
|
34
|
-
# Helper method to build the SQL function. Used with flag `--template`.
|
|
35
|
-
#
|
|
36
|
-
# @!visibility private
|
|
37
|
-
# @private
|
|
38
|
-
# @param index_name [String] Name of the index.
|
|
39
|
-
# @return [String] SQL function body.
|
|
40
|
-
# @see Arfi::Commands::FIdx#create
|
|
41
|
-
# @see Arfi::Commands::FIdx#build_sql_function
|
|
42
|
-
def build_from_file: (string index_name) -> String
|
|
43
|
-
|
|
44
|
-
# +Arfi::Commands::FIdx#functions_dir+ -> Pathname
|
|
45
|
-
#
|
|
46
|
-
# Helper method to get path to `db/functions` directory.
|
|
47
|
-
#
|
|
48
|
-
# @!visibility private
|
|
49
|
-
# @private
|
|
50
|
-
# @return [Pathname] Path to `db/functions` directory
|
|
51
|
-
def functions_dir: () -> Pathname
|
|
52
|
-
|
|
53
|
-
# +Arfi::Commands::FIdx#validate_schema_format!+ -> void
|
|
54
|
-
#
|
|
55
|
-
# Helper method to validate the schema format.
|
|
56
|
-
#
|
|
57
|
-
# @!visibility private
|
|
58
|
-
# @private
|
|
59
|
-
# @raise [Arfi::Errors::InvalidSchemaFormat] if ActiveRecord.schema_format is not :ruby.
|
|
60
|
-
# @return [nil] if the schema format is valid.
|
|
61
|
-
def validate_schema_format!: () -> (untyped | nil)
|
|
62
|
-
|
|
63
|
-
# +Arfi::Commands::FIdx#build_sql_function+ -> String
|
|
64
|
-
#
|
|
65
|
-
# Helper method to build the SQL function.
|
|
66
|
-
#
|
|
67
|
-
# @!visibility private
|
|
68
|
-
# @private
|
|
69
|
-
# @param index_name [String] Name of the index.
|
|
70
|
-
# @return [String] SQL function body.
|
|
71
|
-
def build_sql_function: (string index_name) -> ::String
|
|
72
|
-
|
|
73
|
-
# +Arfi::Commands::FIdx#create_function_file+ -> void
|
|
74
|
-
#
|
|
75
|
-
# Helper method to create the index file.
|
|
76
|
-
#
|
|
77
|
-
# @!visibility private
|
|
78
|
-
# @private
|
|
79
|
-
# @param index_name [String] Name of the index.
|
|
80
|
-
# @param content [String] SQL function body.
|
|
81
|
-
# @return [void]
|
|
82
|
-
def create_function_file: (string index_name, ::String content) -> untyped
|
|
83
|
-
|
|
84
|
-
# +Arfi::Commands::FIdx#extract_latest_version+ -> String
|
|
85
|
-
#
|
|
86
|
-
# Helper method to extract the latest version of the index.
|
|
87
|
-
#
|
|
88
|
-
# @!visibility private
|
|
89
|
-
# @private
|
|
90
|
-
# @param files [Array<String>] List of files.
|
|
91
|
-
# @return [String] Latest version of the index.
|
|
92
|
-
def extract_latest_version: (Array[String] files) -> String
|
|
93
|
-
|
|
94
|
-
# +Arfi::Commands::FIdx#write_file+ -> void
|
|
95
|
-
#
|
|
96
|
-
# Helper method to write the index file.
|
|
97
|
-
#
|
|
98
|
-
# @!visibility private
|
|
99
|
-
# @private
|
|
100
|
-
# @param index_name [String] Name of the index.
|
|
101
|
-
# @param content [String] SQL function body.
|
|
102
|
-
# @param version [String|Integer] Version of the index.
|
|
103
|
-
# @return [void]
|
|
104
|
-
def write_file: (string index_name, ::String content, (::String | ::Integer) version) -> void
|
|
105
|
-
end
|
|
3
|
+
# +Arfi::Commands::FIdx+ module contains commands for manipulating functional index in Rails project.
|
|
4
|
+
#
|
|
5
|
+
# Backward-compatible constant for code that references Arfi::Commands::FIdx.
|
|
6
|
+
# @deprecated
|
|
7
|
+
FIdx: untyped
|
|
106
8
|
end
|
|
107
9
|
end
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
module Arfi
|
|
2
|
+
module Commands
|
|
3
|
+
ADAPTERS: ::Array[:postgresql | :mysql | :trilogy]
|
|
4
|
+
|
|
5
|
+
ROOT_DIR: "db/functions"
|
|
6
|
+
|
|
7
|
+
DEFAULT_SCHEMA: "public"
|
|
8
|
+
|
|
9
|
+
IDENT: ::Regexp
|
|
10
|
+
|
|
11
|
+
type candidate = {
|
|
12
|
+
key: String,
|
|
13
|
+
schema: String,
|
|
14
|
+
function: String,
|
|
15
|
+
source: String,
|
|
16
|
+
origin: String,
|
|
17
|
+
priority: Integer,
|
|
18
|
+
path: String
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type resolved_row = {
|
|
22
|
+
key: String,
|
|
23
|
+
schema: String,
|
|
24
|
+
function: String,
|
|
25
|
+
source: String,
|
|
26
|
+
origin: String,
|
|
27
|
+
priority: Integer,
|
|
28
|
+
path: String,
|
|
29
|
+
?chosen: bool,
|
|
30
|
+
?shadowed: Array[String],
|
|
31
|
+
?shadowed_by: String?
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class Functions < Thor
|
|
35
|
+
# steep:ignore:end
|
|
36
|
+
def create: (String function_ref) -> void
|
|
37
|
+
|
|
38
|
+
# steep:ignore:end
|
|
39
|
+
def destroy: (String function_ref) -> void
|
|
40
|
+
|
|
41
|
+
# steep:ignore:end
|
|
42
|
+
def list: () -> void
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def validate_schema_format!: () -> void
|
|
47
|
+
|
|
48
|
+
def validate_adapter_option!: () -> void
|
|
49
|
+
|
|
50
|
+
def parse_function_ref: (String ref) -> [String?, String]
|
|
51
|
+
|
|
52
|
+
def schema_opt: () -> String?
|
|
53
|
+
|
|
54
|
+
def validate_identifiers!: (String? schema, String function_name) -> void
|
|
55
|
+
|
|
56
|
+
def ensure_dirs!: (adapter: String?, schema: String?) -> void
|
|
57
|
+
|
|
58
|
+
def build_sql_function: (String? schema, String function_name, original_ref: String) -> String
|
|
59
|
+
|
|
60
|
+
def build_from_file: (String? schema, String function_name, original_ref: String) -> String
|
|
61
|
+
|
|
62
|
+
def write_file: (String? schema, String function_name, String content) -> void
|
|
63
|
+
|
|
64
|
+
def canonical_path: (String? schema, String function_name) -> String
|
|
65
|
+
|
|
66
|
+
def function_paths: (String? schema, String function_name) -> Array[String]
|
|
67
|
+
|
|
68
|
+
def adapter_opt: () -> String?
|
|
69
|
+
|
|
70
|
+
def infer_adapter_from_config: () -> String?
|
|
71
|
+
|
|
72
|
+
def resolve_functions_for: (adapter: String) -> Array[::Hash[Symbol, untyped]]
|
|
73
|
+
|
|
74
|
+
def collect_candidates: (glob: ::Pathname, schema: String, source: String, origin: String, priority: Integer) -> Array[candidate]
|
|
75
|
+
|
|
76
|
+
def print_table: (Array[resolved_row] rows) -> void
|
|
77
|
+
|
|
78
|
+
def rel: (::Pathname | String path) -> String
|
|
79
|
+
|
|
80
|
+
def remove_function_file: (String? schema, String function_name) -> void
|
|
81
|
+
|
|
82
|
+
def resolve_adapter: () -> String
|
|
83
|
+
|
|
84
|
+
def render_list: (Array[::Hash[Symbol, untyped]] rows) -> void
|
|
85
|
+
|
|
86
|
+
def resolve_key_group: (Array[candidate] arr) -> Array[::Hash[Symbol, untyped]]
|
|
87
|
+
|
|
88
|
+
def resolve_schema_name: (String? schema) -> String?
|
|
89
|
+
|
|
90
|
+
def collect_all_candidates: (::Pathname root, String adapter) -> Array[candidate]
|
|
91
|
+
|
|
92
|
+
def group_candidates_by_key: (Array[candidate] candidates) -> ::Hash[String, Array[candidate]]
|
|
93
|
+
|
|
94
|
+
def build_resolved_rows: (::Hash[String, Array[candidate]] by_key) -> Array[::Hash[Symbol, untyped]]
|
|
95
|
+
|
|
96
|
+
def validate_function_ref!: (String ref) -> void
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|