inquery 1.0.4 → 1.0.9
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/.releaser_config +1 -0
- data/.rubocop.yml +63 -2
- data/.travis.yml +4 -1
- data/CHANGELOG.md +28 -0
- data/LICENSE +1 -1
- data/README.md +15 -1
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/doc/Inquery.html +3 -3
- data/doc/Inquery/Exceptions.html +3 -3
- data/doc/Inquery/Exceptions/Base.html +3 -3
- data/doc/Inquery/Exceptions/InvalidRelation.html +3 -3
- data/doc/Inquery/Exceptions/UnknownCallSignature.html +3 -3
- data/doc/Inquery/Mixins.html +3 -3
- data/doc/Inquery/Mixins/RawSqlUtils.html +3 -3
- data/doc/Inquery/Mixins/RelationValidation.html +8 -8
- data/doc/Inquery/Mixins/RelationValidation/ClassMethods.html +3 -3
- data/doc/Inquery/Mixins/SchemaValidation.html +3 -3
- data/doc/Inquery/Mixins/SchemaValidation/ClassMethods.html +129 -13
- data/doc/Inquery/Query.html +3 -3
- data/doc/Inquery/Query/Chainable.html +3 -3
- data/doc/_index.html +8 -8
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +20 -4
- data/doc/frames.html +1 -1
- data/doc/index.html +20 -4
- data/doc/method_list.html +27 -11
- data/doc/top-level-namespace.html +3 -3
- data/inquery.gemspec +9 -9
- data/lib/inquery/mixins/relation_validation.rb +8 -8
- data/lib/inquery/mixins/schema_validation.rb +12 -5
- data/test/test_helper.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90b7d62f5ccf00b1ddd813840b80e2bf702d50ae5523a19714130c0c6a3ad570
|
4
|
+
data.tar.gz: 9e45803cfbf729c3d8b1cdc8edbe94b02be8c1d3a700dbd64f8fdeb004884974
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6c71a8976c53fc140110fb6a74f3d5aafe680feedbd92622f39323a0042accd82214229e46b6e6e97e52ee78b1e6d07b660641cd0288010c950bc5d8c9879d7
|
7
|
+
data.tar.gz: 6832e0f4bc345cf8262a64f063d4d4c4d8a0d82922c635130e383720e08ca9b3ca60afada6baa9ba87f72aaf7693eacc57c8b018409252c6cabb0f82b94b6576
|
data/.releaser_config
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,15 +1,32 @@
|
|
1
1
|
AllCops:
|
2
|
+
NewCops: enable
|
2
3
|
Exclude:
|
3
4
|
- 'local/**/*'
|
4
5
|
- 'vendor/**/*'
|
5
6
|
- 'tmp/**/*'
|
6
|
-
- '
|
7
|
+
- 'inquery.gemspec'
|
7
8
|
|
8
9
|
DisplayCopNames: true
|
9
10
|
|
11
|
+
Style/SignalException:
|
12
|
+
EnforcedStyle: only_fail
|
13
|
+
|
10
14
|
Metrics/MethodLength:
|
11
15
|
Enabled: false
|
12
16
|
|
17
|
+
Metrics/ClassLength:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Metrics/ModuleLength:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Metrics/BlockLength:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Metrics/ParameterLists:
|
27
|
+
Max: 5
|
28
|
+
CountKeywordArgs: false
|
29
|
+
|
13
30
|
Metrics/AbcSize:
|
14
31
|
Enabled: False
|
15
32
|
|
@@ -19,9 +36,12 @@ Metrics/CyclomaticComplexity:
|
|
19
36
|
Metrics/PerceivedComplexity:
|
20
37
|
Enabled: False
|
21
38
|
|
22
|
-
|
39
|
+
Layout/LineLength:
|
23
40
|
Max: 160
|
24
41
|
|
42
|
+
Metrics/BlockNesting:
|
43
|
+
Enabled: false
|
44
|
+
|
25
45
|
Style/IfUnlessModifier:
|
26
46
|
Enabled: false
|
27
47
|
|
@@ -31,6 +51,9 @@ Style/Documentation:
|
|
31
51
|
Style/RedundantReturn:
|
32
52
|
Enabled: false
|
33
53
|
|
54
|
+
Style/AsciiComments:
|
55
|
+
Enabled: false
|
56
|
+
|
34
57
|
Style/GuardClause:
|
35
58
|
Enabled: false
|
36
59
|
|
@@ -40,3 +63,41 @@ Style/ClassAndModuleChildren:
|
|
40
63
|
SupportedStyles:
|
41
64
|
- nested
|
42
65
|
- compact
|
66
|
+
# Checks the style of children definitions at classes and modules.
|
67
|
+
#
|
68
|
+
# Basically there are two different styles:
|
69
|
+
#
|
70
|
+
# `nested` - have each child on a separate line
|
71
|
+
# class Foo
|
72
|
+
# class Bar
|
73
|
+
# end
|
74
|
+
# end
|
75
|
+
#
|
76
|
+
# `compact` - combine definitions as much as possible
|
77
|
+
# class Foo::Bar
|
78
|
+
# end
|
79
|
+
#
|
80
|
+
# The compact style is only forced, for classes / modules with one child.
|
81
|
+
|
82
|
+
Style/FormatString:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
# Multiline hashes should be aligned cleanly as a table to improve readability.
|
86
|
+
Layout/HashAlignment:
|
87
|
+
EnforcedHashRocketStyle: table
|
88
|
+
EnforcedColonStyle: table
|
89
|
+
|
90
|
+
Style/FrozenStringLiteralComment:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
Style/AccessorGrouping:
|
94
|
+
Enabled: false
|
95
|
+
|
96
|
+
Style/DoubleNegation:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
Style/ConditionalAssignment:
|
100
|
+
Enabled: false
|
101
|
+
|
102
|
+
Style/CaseLikeIf:
|
103
|
+
Enabled: false
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## 1.0.9 (2021-02-24)
|
4
|
+
|
5
|
+
- Update `schemacop` to version `~> 3.0.8`
|
6
|
+
|
7
|
+
- Add the following ruby versions to travis testing:
|
8
|
+
- `2.5.1`
|
9
|
+
- `2.6.2`
|
10
|
+
- `2.7.1`
|
11
|
+
- `3.0.0`
|
12
|
+
|
13
|
+
- Remove ruby `2.3.0` from travis testing
|
14
|
+
|
15
|
+
## 1.0.8 (2020-11-24)
|
16
|
+
|
17
|
+
- Improve support for schemacop 3.x
|
18
|
+
|
19
|
+
## 1.0.7 (2020-11-24)
|
20
|
+
|
21
|
+
- Improve support for schemacop 3.x
|
22
|
+
|
23
|
+
## 1.0.6 (2020-11-24)
|
24
|
+
|
25
|
+
- Improve support for schemacop 3.x
|
26
|
+
|
27
|
+
## 1.0.5 (2020-11-24)
|
28
|
+
|
29
|
+
- Improve support for schemacop 3.x and document it
|
30
|
+
|
3
31
|
## 1.0.4 (2020-11-24)
|
4
32
|
|
5
33
|
- Add support for schemacop 3.x (but still using 2.x schema version)
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,17 @@ to your `Gemfile`:
|
|
20
20
|
gem 'inquery'
|
21
21
|
```
|
22
22
|
|
23
|
+
## Compatibility
|
24
|
+
|
25
|
+
Inquery is tested with the following ruby versions:
|
26
|
+
|
27
|
+
* 2.5.1
|
28
|
+
* 2.6.2
|
29
|
+
* 2.7.1
|
30
|
+
* 3.0.0
|
31
|
+
|
32
|
+
Other ruby versions might work but are not covered by our Travis tests.
|
33
|
+
|
23
34
|
## Basic usage
|
24
35
|
|
25
36
|
```ruby
|
@@ -284,6 +295,9 @@ class SomeQueryClass < Inquery::Query
|
|
284
295
|
end
|
285
296
|
```
|
286
297
|
|
298
|
+
Inquery supports both schemacop specification versions 2 and 3 using the methods
|
299
|
+
`schema` / `schema2` for version 2 and method `schema3` for version 3.
|
300
|
+
|
287
301
|
## Rails integration
|
288
302
|
|
289
303
|
While it is optional, Inquery has been written from the ground up to be
|
@@ -322,4 +336,4 @@ in his [blog post](http://craftingruby.com/posts/2015/06/29/query-objects-throug
|
|
322
336
|
|
323
337
|
## Copyright
|
324
338
|
|
325
|
-
Copyright
|
339
|
+
Copyright © 2016 - 2021 Sitrox. See `LICENSE` for further details.
|
data/Rakefile
CHANGED
@@ -16,12 +16,12 @@ task :gemspec do
|
|
16
16
|
spec.add_development_dependency 'sqlite3'
|
17
17
|
spec.add_development_dependency 'haml'
|
18
18
|
spec.add_development_dependency 'yard'
|
19
|
-
spec.add_development_dependency 'rubocop', '0.
|
19
|
+
spec.add_development_dependency 'rubocop', '0.92.0'
|
20
20
|
spec.add_development_dependency 'redcarpet'
|
21
21
|
spec.add_dependency 'minitest'
|
22
22
|
spec.add_dependency 'activesupport'
|
23
23
|
spec.add_dependency 'activerecord'
|
24
|
-
spec.add_dependency 'schemacop', '
|
24
|
+
spec.add_dependency 'schemacop', '~> 3.0.8'
|
25
25
|
end
|
26
26
|
|
27
27
|
File.open('inquery.gemspec', 'w') { |f| f.write(gemspec.to_ruby.strip) }
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.9
|
data/doc/Inquery.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Inquery
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -109,9 +109,9 @@
|
|
109
109
|
</div>
|
110
110
|
|
111
111
|
<div id="footer">
|
112
|
-
Generated on
|
112
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
113
113
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
114
|
-
0.9.
|
114
|
+
0.9.26 (ruby-2.6.2).
|
115
115
|
</div>
|
116
116
|
|
117
117
|
</div>
|
data/doc/Inquery/Exceptions.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Inquery::Exceptions
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -105,9 +105,9 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
|
-
0.9.
|
110
|
+
0.9.26 (ruby-2.6.2).
|
111
111
|
</div>
|
112
112
|
|
113
113
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Inquery::Exceptions::Base
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -118,9 +118,9 @@
|
|
118
118
|
</div>
|
119
119
|
|
120
120
|
<div id="footer">
|
121
|
-
Generated on
|
121
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
122
122
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
123
|
-
0.9.
|
123
|
+
0.9.26 (ruby-2.6.2).
|
124
124
|
</div>
|
125
125
|
|
126
126
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Inquery::Exceptions::InvalidRelation
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -122,9 +122,9 @@
|
|
122
122
|
</div>
|
123
123
|
|
124
124
|
<div id="footer">
|
125
|
-
Generated on
|
125
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
126
126
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
127
|
-
0.9.
|
127
|
+
0.9.26 (ruby-2.6.2).
|
128
128
|
</div>
|
129
129
|
|
130
130
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Inquery::Exceptions::UnknownCallSignature
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -122,9 +122,9 @@
|
|
122
122
|
</div>
|
123
123
|
|
124
124
|
<div id="footer">
|
125
|
-
Generated on
|
125
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
126
126
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
127
|
-
0.9.
|
127
|
+
0.9.26 (ruby-2.6.2).
|
128
128
|
</div>
|
129
129
|
|
130
130
|
</div>
|
data/doc/Inquery/Mixins.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Inquery::Mixins
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -107,9 +107,9 @@
|
|
107
107
|
</div>
|
108
108
|
|
109
109
|
<div id="footer">
|
110
|
-
Generated on
|
110
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
|
-
0.9.
|
112
|
+
0.9.26 (ruby-2.6.2).
|
113
113
|
</div>
|
114
114
|
|
115
115
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Inquery::Mixins::RawSqlUtils
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -106,9 +106,9 @@
|
|
106
106
|
</div>
|
107
107
|
|
108
108
|
<div id="footer">
|
109
|
-
Generated on
|
109
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
|
-
0.9.
|
111
|
+
0.9.26 (ruby-2.6.2).
|
112
112
|
</div>
|
113
113
|
|
114
114
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Inquery::Mixins::RelationValidation
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -130,26 +130,26 @@
|
|
130
130
|
</span> <span class='comment'># `nil` to not perform any checks. The `class` attribute will also be
|
131
131
|
</span> <span class='comment'># taken to infer a default if no relation is given and you didn't
|
132
132
|
</span> <span class='comment'># specify any `default`.
|
133
|
-
</span> <span class='label'>class:</span>
|
133
|
+
</span> <span class='label'>class:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
134
134
|
|
135
135
|
<span class='comment'># This allows to specify a default relation that will be taken if no
|
136
136
|
</span> <span class='comment'># relation is given. This must be specified as a Proc returning the
|
137
137
|
</span> <span class='comment'># relation. Set this to `false` for no default. If this is set to `nil`,
|
138
138
|
</span> <span class='comment'># it will try to infer the default from the option `class` (if given).
|
139
|
-
</span> <span class='label'>default:</span>
|
139
|
+
</span> <span class='label'>default:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
140
140
|
|
141
141
|
<span class='comment'># Allows to restrict the number of fields / values the relation must
|
142
142
|
</span> <span class='comment'># select. This is particularly useful if you're using the query as a
|
143
143
|
</span> <span class='comment'># subquery and need it to return exactly one field. Use `nil` to not
|
144
144
|
</span> <span class='comment'># perform any checks.
|
145
|
-
</span> <span class='label'>fields:</span>
|
145
|
+
</span> <span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
146
146
|
|
147
147
|
<span class='comment'># If this is set to a symbol, the relation does not have any select
|
148
148
|
</span> <span class='comment'># fields specified (`select_values` is empty) and `fields` is > 0, it
|
149
149
|
</span> <span class='comment'># will automatically select the given field. Use `nil` to disable this
|
150
150
|
</span> <span class='comment'># behavior.
|
151
151
|
</span> <span class='label'>default_select:</span> <span class='symbol'>:id</span>
|
152
|
-
<span class='rbrace'>}</span></pre></dd>
|
152
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
153
153
|
|
154
154
|
</dl>
|
155
155
|
|
@@ -304,7 +304,7 @@ options specified at class level using the <code>relation</code> method.</p>
|
|
304
304
|
</span> <span class='comment'># ---------------------------------------------------------------
|
305
305
|
</span> <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>=</span> <span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_select_values'>select_values</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
306
306
|
|
307
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_fields_count'>fields_count</span
|
307
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_fields_count'>fields_count</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span> <span class='op'>&&</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
|
308
308
|
<span class='id identifier rubyid_relation'>relation</span> <span class='op'>=</span> <span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
309
309
|
<span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>=</span> <span class='int'>1</span>
|
310
310
|
<span class='kw'>end</span>
|
@@ -325,9 +325,9 @@ options specified at class level using the <code>relation</code> method.</p>
|
|
325
325
|
</div>
|
326
326
|
|
327
327
|
<div id="footer">
|
328
|
-
Generated on
|
328
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
329
329
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
330
|
-
0.9.
|
330
|
+
0.9.26 (ruby-2.6.2).
|
331
331
|
</div>
|
332
332
|
|
333
333
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Inquery::Mixins::RelationValidation::ClassMethods
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -178,9 +178,9 @@ on. See <span class='object_link'><a href="../RelationValidation.html#OPTIONS_SC
|
|
178
178
|
</div>
|
179
179
|
|
180
180
|
<div id="footer">
|
181
|
-
Generated on
|
181
|
+
Generated on Wed Feb 24 10:57:42 2021 by
|
182
182
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
183
|
-
0.9.
|
183
|
+
0.9.26 (ruby-2.6.2).
|
184
184
|
</div>
|
185
185
|
|
186
186
|
</div>
|