arel_toolkit 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +29 -0
  3. data/.gitignore +5 -0
  4. data/.rubocop.yml +34 -0
  5. data/.ruby-version +1 -1
  6. data/.travis.yml +16 -2
  7. data/CHANGELOG.md +10 -0
  8. data/Gemfile +1 -1
  9. data/Gemfile.lock +94 -1
  10. data/Guardfile +42 -0
  11. data/README.md +23 -4
  12. data/Rakefile +3 -3
  13. data/arel_toolkit.gemspec +32 -15
  14. data/bin/console +4 -7
  15. data/lib/arel/extensions.rb +71 -0
  16. data/lib/arel/extensions/absolute.rb +10 -0
  17. data/lib/arel/extensions/all.rb +23 -0
  18. data/lib/arel/extensions/any.rb +23 -0
  19. data/lib/arel/extensions/array.rb +29 -0
  20. data/lib/arel/extensions/array_subselect.rb +23 -0
  21. data/lib/arel/extensions/between_symmetric.rb +23 -0
  22. data/lib/arel/extensions/bit_string.rb +27 -0
  23. data/lib/arel/extensions/bitwise_xor.rb +10 -0
  24. data/lib/arel/extensions/coalesce.rb +9 -0
  25. data/lib/arel/extensions/conflict.rb +47 -0
  26. data/lib/arel/extensions/contained_by.rb +10 -0
  27. data/lib/arel/extensions/contains.rb +10 -0
  28. data/lib/arel/extensions/cross_join.rb +21 -0
  29. data/lib/arel/extensions/cube_root.rb +10 -0
  30. data/lib/arel/extensions/current_catalog.rb +20 -0
  31. data/lib/arel/extensions/current_date.rb +20 -0
  32. data/lib/arel/extensions/current_of_expression.rb +29 -0
  33. data/lib/arel/extensions/current_role.rb +20 -0
  34. data/lib/arel/extensions/current_schema.rb +20 -0
  35. data/lib/arel/extensions/current_time.rb +22 -0
  36. data/lib/arel/extensions/current_timestamp.rb +22 -0
  37. data/lib/arel/extensions/current_user.rb +20 -0
  38. data/lib/arel/extensions/default_values.rb +21 -0
  39. data/lib/arel/extensions/delete_statement.rb +49 -0
  40. data/lib/arel/extensions/distinct_from.rb +22 -0
  41. data/lib/arel/extensions/equality.rb +30 -0
  42. data/lib/arel/extensions/except_all.rb +21 -0
  43. data/lib/arel/extensions/exponentiation.rb +10 -0
  44. data/lib/arel/extensions/factorial.rb +33 -0
  45. data/lib/arel/extensions/function.rb +68 -0
  46. data/lib/arel/extensions/generate_series.rb +9 -0
  47. data/lib/arel/extensions/greatest.rb +9 -0
  48. data/lib/arel/extensions/indirection.rb +32 -0
  49. data/lib/arel/extensions/infer.rb +35 -0
  50. data/lib/arel/extensions/insert_statement.rb +69 -0
  51. data/lib/arel/extensions/intersect_all.rb +21 -0
  52. data/lib/arel/extensions/lateral.rb +34 -0
  53. data/lib/arel/extensions/least.rb +9 -0
  54. data/lib/arel/extensions/local_time.rb +22 -0
  55. data/lib/arel/extensions/local_timestamp.rb +22 -0
  56. data/lib/arel/extensions/modulo.rb +10 -0
  57. data/lib/arel/extensions/named_function.rb +15 -0
  58. data/lib/arel/extensions/natural_join.rb +21 -0
  59. data/lib/arel/extensions/not_between.rb +22 -0
  60. data/lib/arel/extensions/not_between_symmetric.rb +23 -0
  61. data/lib/arel/extensions/not_distinct_from.rb +22 -0
  62. data/lib/arel/extensions/not_equal.rb +30 -0
  63. data/lib/arel/extensions/not_similar.rb +29 -0
  64. data/lib/arel/extensions/null_if.rb +24 -0
  65. data/lib/arel/extensions/ordering.rb +47 -0
  66. data/lib/arel/extensions/overlap.rb +10 -0
  67. data/lib/arel/extensions/range_function.rb +23 -0
  68. data/lib/arel/extensions/rank.rb +9 -0
  69. data/lib/arel/extensions/row.rb +30 -0
  70. data/lib/arel/extensions/select_statement.rb +26 -0
  71. data/lib/arel/extensions/session_user.rb +20 -0
  72. data/lib/arel/extensions/set_to_default.rb +21 -0
  73. data/lib/arel/extensions/similar.rb +32 -0
  74. data/lib/arel/extensions/square_root.rb +10 -0
  75. data/lib/arel/extensions/table.rb +49 -0
  76. data/lib/arel/extensions/time_with_precision.rb +13 -0
  77. data/lib/arel/extensions/type_cast.rb +30 -0
  78. data/lib/arel/extensions/unknown.rb +20 -0
  79. data/lib/arel/extensions/update_statement.rb +63 -0
  80. data/lib/arel/extensions/user.rb +20 -0
  81. data/lib/arel/extensions/with_ordinality.rb +22 -0
  82. data/lib/arel/sql_to_arel.rb +8 -0
  83. data/lib/arel/sql_to_arel/frame_options.rb +110 -0
  84. data/lib/arel/sql_to_arel/pg_query_visitor.rb +1005 -0
  85. data/lib/arel/sql_to_arel/unbound_column_reference.rb +5 -0
  86. data/lib/arel_toolkit.rb +4 -3
  87. data/lib/arel_toolkit/version.rb +1 -1
  88. metadata +250 -4
@@ -0,0 +1,5 @@
1
+ module Arel
2
+ module SqlToArel
3
+ class UnboundColumnReference < ::Arel::Nodes::SqlLiteral; end
4
+ end
5
+ end
data/lib/arel_toolkit.rb CHANGED
@@ -1,6 +1,7 @@
1
- require "arel_toolkit/version"
1
+ require 'arel_toolkit/version'
2
+ require 'arel'
3
+ require 'arel/extensions'
4
+ require 'arel/sql_to_arel'
2
5
 
3
6
  module ArelToolkit
4
- class Error < StandardError; end
5
- # Your code goes here...
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module ArelToolkit
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - maarten
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-16 00:00:00.000000000 Z
11
+ date: 2019-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: arel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 9.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 9.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: pg_query
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.1.0
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: bundler
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,27 +80,244 @@ dependencies:
52
80
  - - "~>"
53
81
  - !ruby/object:Gem::Version
54
82
  version: '3.8'
55
- description: ArelToolkit contains parsing, querying, modifying, optimisations, extensions
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.16.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.16.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov-console
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.4.2
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.4.2
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.69'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.69'
125
+ - !ruby/object:Gem::Dependency
126
+ name: guard
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '2.15'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '2.15'
139
+ - !ruby/object:Gem::Dependency
140
+ name: guard-rspec
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '4.7'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '4.7'
153
+ - !ruby/object:Gem::Dependency
154
+ name: pry
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: pry-nav
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: pry-rescue
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: pry-stack_explorer
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: pry-alias
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ description: 'ArelToolkit contains parsing, querying, modifying, optimisations, extensions
56
224
  and more for Arel.
225
+
226
+ '
57
227
  email:
58
228
  - maarten@vgijssel.nl
59
229
  executables: []
60
230
  extensions: []
61
231
  extra_rdoc_files: []
62
232
  files:
233
+ - ".codeclimate.yml"
63
234
  - ".gitignore"
64
235
  - ".rspec"
236
+ - ".rubocop.yml"
65
237
  - ".ruby-version"
66
238
  - ".travis.yml"
239
+ - CHANGELOG.md
67
240
  - CODE_OF_CONDUCT.md
68
241
  - Gemfile
69
242
  - Gemfile.lock
243
+ - Guardfile
70
244
  - LICENSE.txt
71
245
  - README.md
72
246
  - Rakefile
73
247
  - arel_toolkit.gemspec
74
248
  - bin/console
75
249
  - bin/setup
250
+ - lib/arel/extensions.rb
251
+ - lib/arel/extensions/absolute.rb
252
+ - lib/arel/extensions/all.rb
253
+ - lib/arel/extensions/any.rb
254
+ - lib/arel/extensions/array.rb
255
+ - lib/arel/extensions/array_subselect.rb
256
+ - lib/arel/extensions/between_symmetric.rb
257
+ - lib/arel/extensions/bit_string.rb
258
+ - lib/arel/extensions/bitwise_xor.rb
259
+ - lib/arel/extensions/coalesce.rb
260
+ - lib/arel/extensions/conflict.rb
261
+ - lib/arel/extensions/contained_by.rb
262
+ - lib/arel/extensions/contains.rb
263
+ - lib/arel/extensions/cross_join.rb
264
+ - lib/arel/extensions/cube_root.rb
265
+ - lib/arel/extensions/current_catalog.rb
266
+ - lib/arel/extensions/current_date.rb
267
+ - lib/arel/extensions/current_of_expression.rb
268
+ - lib/arel/extensions/current_role.rb
269
+ - lib/arel/extensions/current_schema.rb
270
+ - lib/arel/extensions/current_time.rb
271
+ - lib/arel/extensions/current_timestamp.rb
272
+ - lib/arel/extensions/current_user.rb
273
+ - lib/arel/extensions/default_values.rb
274
+ - lib/arel/extensions/delete_statement.rb
275
+ - lib/arel/extensions/distinct_from.rb
276
+ - lib/arel/extensions/equality.rb
277
+ - lib/arel/extensions/except_all.rb
278
+ - lib/arel/extensions/exponentiation.rb
279
+ - lib/arel/extensions/factorial.rb
280
+ - lib/arel/extensions/function.rb
281
+ - lib/arel/extensions/generate_series.rb
282
+ - lib/arel/extensions/greatest.rb
283
+ - lib/arel/extensions/indirection.rb
284
+ - lib/arel/extensions/infer.rb
285
+ - lib/arel/extensions/insert_statement.rb
286
+ - lib/arel/extensions/intersect_all.rb
287
+ - lib/arel/extensions/lateral.rb
288
+ - lib/arel/extensions/least.rb
289
+ - lib/arel/extensions/local_time.rb
290
+ - lib/arel/extensions/local_timestamp.rb
291
+ - lib/arel/extensions/modulo.rb
292
+ - lib/arel/extensions/named_function.rb
293
+ - lib/arel/extensions/natural_join.rb
294
+ - lib/arel/extensions/not_between.rb
295
+ - lib/arel/extensions/not_between_symmetric.rb
296
+ - lib/arel/extensions/not_distinct_from.rb
297
+ - lib/arel/extensions/not_equal.rb
298
+ - lib/arel/extensions/not_similar.rb
299
+ - lib/arel/extensions/null_if.rb
300
+ - lib/arel/extensions/ordering.rb
301
+ - lib/arel/extensions/overlap.rb
302
+ - lib/arel/extensions/range_function.rb
303
+ - lib/arel/extensions/rank.rb
304
+ - lib/arel/extensions/row.rb
305
+ - lib/arel/extensions/select_statement.rb
306
+ - lib/arel/extensions/session_user.rb
307
+ - lib/arel/extensions/set_to_default.rb
308
+ - lib/arel/extensions/similar.rb
309
+ - lib/arel/extensions/square_root.rb
310
+ - lib/arel/extensions/table.rb
311
+ - lib/arel/extensions/time_with_precision.rb
312
+ - lib/arel/extensions/type_cast.rb
313
+ - lib/arel/extensions/unknown.rb
314
+ - lib/arel/extensions/update_statement.rb
315
+ - lib/arel/extensions/user.rb
316
+ - lib/arel/extensions/with_ordinality.rb
317
+ - lib/arel/sql_to_arel.rb
318
+ - lib/arel/sql_to_arel/frame_options.rb
319
+ - lib/arel/sql_to_arel/pg_query_visitor.rb
320
+ - lib/arel/sql_to_arel/unbound_column_reference.rb
76
321
  - lib/arel_toolkit.rb
77
322
  - lib/arel_toolkit/version.rb
78
323
  homepage: https://github.com/mvgijssel/arel_toolkit
@@ -94,7 +339,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
339
  - !ruby/object:Gem::Version
95
340
  version: '0'
96
341
  requirements: []
97
- rubygems_version: 3.0.1
342
+ rubyforge_project:
343
+ rubygems_version: 2.7.6
98
344
  signing_key:
99
345
  specification_version: 4
100
346
  summary: Collection of tools for Arel