Skip to content

Commit a8d45f3

Browse files
committed
Reorganize & update dependencies
1 parent a0ac1e3 commit a8d45f3

6 files changed

Lines changed: 193 additions & 119 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ jobs:
1414
- name: Set up Ruby
1515
uses: ruby/setup-ruby@v1
1616
- name: Install dependencies
17-
run: |
18-
bundle config set --local without 'gruff'
19-
bundle install
17+
run: bundle install
2018
- name: Run tests
2119
run: bundle exec rspec

Gemfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ source "https://rubygems.org"
33
# Specify your gem's dependencies in graphql-groups.gemspec
44
gemspec
55

6-
group :gruff do
7-
gem 'gruff', '~> 0.29'
6+
group :development, :test do
7+
gem 'activerecord', '~> 8'
8+
gem 'database_cleaner-active_record', '~> 2.1'
9+
gem 'gqli', '~> 1.0'
10+
gem 'groupdate', '~> 6.7'
11+
gem 'rspec', '~> 3.0'
12+
gem 'rubocop', '~> 1.84'
13+
gem 'rubocop-rspec', '~> 3.9'
14+
gem 'simplecov', '~> 0.22'
15+
gem 'sqlite3', '~> 2.9'
816
end

Gemfile.lock

Lines changed: 168 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -7,147 +7,220 @@ PATH
77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
activemodel (7.2.1.2)
11-
activesupport (= 7.2.1.2)
12-
activerecord (7.2.1.2)
13-
activemodel (= 7.2.1.2)
14-
activesupport (= 7.2.1.2)
10+
activemodel (8.1.2)
11+
activesupport (= 8.1.2)
12+
activerecord (8.1.2)
13+
activemodel (= 8.1.2)
14+
activesupport (= 8.1.2)
1515
timeout (>= 0.4.0)
16-
activesupport (7.2.1.2)
16+
activesupport (8.1.2)
1717
base64
1818
bigdecimal
1919
concurrent-ruby (~> 1.0, >= 1.3.1)
2020
connection_pool (>= 2.2.5)
2121
drb
2222
i18n (>= 1.6, < 2)
23+
json
2324
logger (>= 1.4.2)
2425
minitest (>= 5.1)
2526
securerandom (>= 0.3)
2627
tzinfo (~> 2.0, >= 2.0.5)
27-
addressable (2.8.0)
28-
public_suffix (>= 2.0.2, < 5.0)
29-
ast (2.4.1)
28+
uri (>= 0.13.1)
29+
addressable (2.8.8)
30+
public_suffix (>= 2.0.2, < 8.0)
31+
ast (2.4.3)
3032
base64 (0.3.0)
31-
benchmark-ips (2.8.2)
32-
bigdecimal (3.1.8)
33-
concurrent-ruby (1.3.4)
34-
connection_pool (2.4.1)
35-
database_cleaner-active_record (2.2.0)
33+
bigdecimal (4.0.1)
34+
concurrent-ruby (1.3.6)
35+
connection_pool (3.0.2)
36+
database_cleaner-active_record (2.2.2)
3637
activerecord (>= 5.a)
37-
database_cleaner-core (~> 2.0.0)
38+
database_cleaner-core (~> 2.0)
3839
database_cleaner-core (2.0.1)
39-
diff-lcs (1.4.4)
40+
diff-lcs (1.6.2)
4041
docile (1.4.1)
41-
domain_name (0.5.20190701)
42-
unf (>= 0.0.5, < 1.0.0)
43-
drb (2.2.1)
42+
domain_name (0.6.20240107)
43+
drb (2.2.3)
44+
ffi (1.17.3)
45+
ffi (1.17.3-x86_64-linux-gnu)
46+
ffi-compiler (1.3.2)
47+
ffi (>= 1.15.5)
48+
rake
4449
fiber-storage (1.0.1)
45-
gqli (1.0.0)
46-
hashie (~> 3.0)
47-
http (> 0.8, < 3.0)
50+
gqli (1.2.0)
51+
hashie (> 3.0)
52+
http (> 0.8, < 6.0)
4853
multi_json (~> 1)
49-
graphql (2.5.18)
54+
graphql (2.5.19)
5055
base64
5156
fiber-storage
5257
logger
53-
groupdate (6.5.1)
54-
activesupport (>= 7)
55-
gruff (0.29.0)
56-
bigdecimal (>= 3.0)
57-
histogram
58-
rmagick (>= 5.5)
59-
hashie (3.6.0)
60-
histogram (0.2.4.1)
61-
http (2.2.2)
62-
addressable (~> 2.3)
58+
groupdate (6.7.0)
59+
activesupport (>= 7.1)
60+
hashie (5.1.0)
61+
logger
62+
http (5.3.1)
63+
addressable (~> 2.8)
6364
http-cookie (~> 1.0)
64-
http-form_data (~> 1.0.1)
65-
http_parser.rb (~> 0.6.0)
66-
http-cookie (1.0.3)
65+
http-form_data (~> 2.2)
66+
llhttp-ffi (~> 0.5.0)
67+
http-cookie (1.1.0)
6768
domain_name (~> 0.5)
68-
http-form_data (1.0.3)
69-
http_parser.rb (0.6.0)
70-
i18n (1.14.6)
69+
http-form_data (2.3.0)
70+
i18n (1.14.8)
7171
concurrent-ruby (~> 1.0)
72-
logger (1.6.1)
73-
mini_portile2 (2.8.7)
74-
minitest (5.25.1)
75-
multi_json (1.15.0)
76-
observer (0.1.2)
77-
parallel (1.19.2)
78-
parser (2.7.1.4)
72+
json (2.18.1)
73+
language_server-protocol (3.17.0.5)
74+
lint_roller (1.1.0)
75+
llhttp-ffi (0.5.1)
76+
ffi-compiler (~> 1.0)
77+
rake (~> 13.0)
78+
logger (1.7.0)
79+
mini_portile2 (2.8.9)
80+
minitest (6.0.1)
81+
prism (~> 1.5)
82+
multi_json (1.19.1)
83+
parallel (1.27.0)
84+
parser (3.3.10.1)
7985
ast (~> 2.4.1)
80-
pkg-config (1.6.5)
81-
public_suffix (4.0.6)
82-
rainbow (3.0.0)
83-
rake (13.0.1)
84-
regexp_parser (1.7.1)
85-
rexml (3.3.9)
86-
rmagick (6.1.5)
87-
observer (~> 0.1)
88-
pkg-config (~> 1.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.2)
94-
rspec-support (~> 3.9.3)
95-
rspec-expectations (3.9.2)
86+
racc
87+
prism (1.9.0)
88+
public_suffix (7.0.2)
89+
racc (1.8.1)
90+
rainbow (3.1.1)
91+
rake (13.3.1)
92+
regexp_parser (2.11.3)
93+
rspec (3.13.2)
94+
rspec-core (~> 3.13.0)
95+
rspec-expectations (~> 3.13.0)
96+
rspec-mocks (~> 3.13.0)
97+
rspec-core (3.13.6)
98+
rspec-support (~> 3.13.0)
99+
rspec-expectations (3.13.5)
96100
diff-lcs (>= 1.2.0, < 2.0)
97-
rspec-support (~> 3.9.0)
98-
rspec-mocks (3.9.1)
101+
rspec-support (~> 3.13.0)
102+
rspec-mocks (3.13.7)
99103
diff-lcs (>= 1.2.0, < 2.0)
100-
rspec-support (~> 3.9.0)
101-
rspec-support (3.9.3)
102-
rubocop (0.88.0)
104+
rspec-support (~> 3.13.0)
105+
rspec-support (3.13.7)
106+
rubocop (1.84.1)
107+
json (~> 2.3)
108+
language_server-protocol (~> 3.17.0.2)
109+
lint_roller (~> 1.1.0)
103110
parallel (~> 1.10)
104-
parser (>= 2.7.1.1)
111+
parser (>= 3.3.0.2)
105112
rainbow (>= 2.2.2, < 4.0)
106-
regexp_parser (>= 1.7)
107-
rexml
108-
rubocop-ast (>= 0.1.0, < 1.0)
113+
regexp_parser (>= 2.9.3, < 3.0)
114+
rubocop-ast (>= 1.49.0, < 2.0)
109115
ruby-progressbar (~> 1.7)
110-
unicode-display_width (>= 1.4.0, < 2.0)
111-
rubocop-ast (0.1.0)
112-
parser (>= 2.7.0.1)
113-
rubocop-rspec (1.42.0)
114-
rubocop (>= 0.87.0)
115-
ruby-progressbar (1.10.1)
116-
securerandom (0.3.1)
116+
unicode-display_width (>= 2.4.0, < 4.0)
117+
rubocop-ast (1.49.0)
118+
parser (>= 3.3.7.2)
119+
prism (~> 1.7)
120+
rubocop-rspec (3.9.0)
121+
lint_roller (~> 1.1)
122+
rubocop (~> 1.81)
123+
ruby-progressbar (1.13.0)
124+
securerandom (0.4.1)
117125
simplecov (0.22.0)
118126
docile (~> 1.1)
119127
simplecov-html (~> 0.11)
120128
simplecov_json_formatter (~> 0.1)
121-
simplecov-html (0.13.1)
129+
simplecov-html (0.13.2)
122130
simplecov_json_formatter (0.1.4)
123-
sqlite3 (2.1.1)
131+
sqlite3 (2.9.0)
124132
mini_portile2 (~> 2.8.0)
125-
timeout (0.4.1)
133+
sqlite3 (2.9.0-x86_64-linux-gnu)
134+
timeout (0.6.0)
126135
tzinfo (2.0.6)
127136
concurrent-ruby (~> 1.0)
128-
unf (0.1.4)
129-
unf_ext
130-
unf_ext (0.0.7.7)
131-
unicode-display_width (1.7.0)
137+
unicode-display_width (3.2.0)
138+
unicode-emoji (~> 4.1)
139+
unicode-emoji (4.2.0)
140+
uri (1.1.1)
132141

133142
PLATFORMS
134143
ruby
144+
x86_64-linux
135145

136146
DEPENDENCIES
137-
activerecord (~> 7.2)
138-
benchmark-ips (~> 2.8)
139-
bundler (~> 2.0)
147+
activerecord (~> 8)
140148
database_cleaner-active_record (~> 2.1)
141149
gqli (~> 1.0)
142150
graphql-groups!
143-
groupdate (~> 6.5.1)
144-
gruff (~> 0.29)
145-
rake (~> 13.0)
151+
groupdate (~> 6.7)
152+
rake (~> 13.3)
146153
rspec (~> 3.0)
147-
rubocop (~> 0.88)
148-
rubocop-rspec (~> 1.42)
154+
rubocop (~> 1.84)
155+
rubocop-rspec (~> 3.9)
149156
simplecov (~> 0.22)
150-
sqlite3 (~> 2.1.1)
157+
sqlite3 (~> 2.9)
158+
159+
CHECKSUMS
160+
activemodel (8.1.2) sha256=e21358c11ce68aed3f9838b7e464977bc007b4446c6e4059781e1d5c03bcf33e
161+
activerecord (8.1.2) sha256=acfbe0cadfcc50fa208011fe6f4eb01cae682ebae0ef57145ba45380c74bcc44
162+
activesupport (8.1.2) sha256=88842578ccd0d40f658289b0e8c842acfe9af751afee2e0744a7873f50b6fdae
163+
addressable (2.8.8) sha256=7c13b8f9536cf6364c03b9d417c19986019e28f7c00ac8132da4eb0fe393b057
164+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
165+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
166+
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
167+
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
168+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
169+
database_cleaner-active_record (2.2.2) sha256=88296b9f3088c31f7c0d4fcec10f68e4b71c96698043916de59b04debec10388
170+
database_cleaner-core (2.0.1) sha256=8646574c32162e59ed7b5258a97a208d3c44551b854e510994f24683865d846c
171+
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
172+
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
173+
domain_name (0.6.20240107) sha256=5f693b2215708476517479bf2b3802e49068ad82167bcd2286f899536a17d933
174+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
175+
ffi (1.17.3) sha256=0e9f39f7bb3934f77ad6feab49662be77e87eedcdeb2a3f5c0234c2938563d4c
176+
ffi (1.17.3-x86_64-linux-gnu) sha256=3746b01f677aae7b16dc1acb7cb3cc17b3e35bdae7676a3f568153fb0e2c887f
177+
ffi-compiler (1.3.2) sha256=a94f3d81d12caf5c5d4ecf13980a70d0aeaa72268f3b9cc13358bcc6509184a0
178+
fiber-storage (1.0.1) sha256=f48e5b6d8b0be96dac486332b55cee82240057065dc761c1ea692b2e719240e1
179+
gqli (1.2.0) sha256=e0e103a7dc324572ea5dbcbb22a9f8815041bccf078e4da5612d99ab540370de
180+
graphql (2.5.19) sha256=6c70cf41cbe7d02921fb679229689d181768a45a2a7cc2f39b240cdf3a5fa299
181+
graphql-groups (0.2.3)
182+
groupdate (6.7.0) sha256=beaa8d5bf3856814681914a1d4a20e77436a2214b85d0017dc2ea5c355fb6777
183+
hashie (5.1.0) sha256=c266471896f323c446ea8207f8ffac985d2718df0a0ba98651a3057096ca3870
184+
http (5.3.1) sha256=c50802d8e9be3926cb84ac3b36d1a31fbbac383bc4cbecdce9053cb604231d7d
185+
http-cookie (1.1.0) sha256=38a5e60d1527eebc396831b8c4b9455440509881219273a6c99943d29eadbb19
186+
http-form_data (2.3.0) sha256=cc4eeb1361d9876821e31d7b1cf0b68f1cf874b201d27903480479d86448a5f3
187+
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
188+
json (2.18.1) sha256=fe112755501b8d0466b5ada6cf50c8c3f41e897fa128ac5d263ec09eedc9f986
189+
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
190+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
191+
llhttp-ffi (0.5.1) sha256=9a25a7fc19311f691a78c9c0ac0fbf4675adbd0cca74310228fdf841018fa7bc
192+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
193+
mini_portile2 (2.8.9) sha256=0cd7c7f824e010c072e33f68bc02d85a00aeb6fce05bb4819c03dfd3c140c289
194+
minitest (6.0.1) sha256=7854c74f48e2e975969062833adc4013f249a4b212f5e7b9d5c040bf838d54bb
195+
multi_json (1.19.1) sha256=7aefeff8f2c854bf739931a238e4aea64592845e0c0395c8a7d2eea7fdd631b7
196+
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
197+
parser (3.3.10.1) sha256=06f6a725d2cd91e5e7f2b7c32ba143631e1f7c8ae2fb918fc4cebec187e6a688
198+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
199+
public_suffix (7.0.2) sha256=9114090c8e4e7135c1fd0e7acfea33afaab38101884320c65aaa0ffb8e26a857
200+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
201+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
202+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
203+
regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
204+
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
205+
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
206+
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
207+
rspec-mocks (3.13.7) sha256=0979034e64b1d7a838aaaddf12bf065ea4dc40ef3d4c39f01f93ae2c66c62b1c
208+
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
209+
rubocop (1.84.1) sha256=14cc626f355141f5a2ef53c10a68d66b13bb30639b26370a76559096cc6bcc1a
210+
rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
211+
rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
212+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
213+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
214+
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
215+
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
216+
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
217+
sqlite3 (2.9.0) sha256=ece9c00b32ec5f550d3a4a35c41ea8d738563589f090b9dfd0d510b7ae5f296c
218+
sqlite3 (2.9.0-x86_64-linux-gnu) sha256=72fff9bd750070ba3af695511ba5f0e0a2d8a9206f84869640b3e99dfaf3d5a5
219+
timeout (0.6.0) sha256=6d722ad619f96ee383a0c557ec6eb8c4ecb08af3af62098a0be5057bf00de1af
220+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
221+
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
222+
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
223+
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
151224

152225
BUNDLED WITH
153-
2.3.16
226+
4.0.6

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ query myQuery{
7474

7575
`graphql-groups` allows you to write flexible, readable queries while leveraging your database to aggreate data. It does so by performing an AST analysis on your request and executing exactly the database queries needed to fulfill it. This performs much better than grouping and aggregating in memory. See [performance](#Performance) for a benchmark.
7676

77-
78-
## Advanced Usage
79-
80-
For a showcase of what you can do with `graphql-groups` check out [graphql-groups-demo](https://github.com/hschne/graphql-groups-demo)
81-
8277
### Grouping by Multiple Attributes
8378

8479
This library really shines when you want to group by multiple attributes, or otherwise retrieve complex statistical information
@@ -265,7 +260,19 @@ While it is possible to add grouping to your GraphQL schema by using `group_by`
265260

266261
The benchmark queries the author count grouped by name, using an increasing number of authors. While the in-memory approach of grouping works well for a small number of records, it is outperformed quickly as that number increases.
267262

268-
Benchmarks can be generated by running `rake benchmark`. The benchmark script used to generate the report be found [here](./benchmark/benchmark.rb)
263+
To run the benchmarks yourself, first install the required gems (note: `gruff` requires ImageMagick):
264+
265+
```bash
266+
gem install benchmark-ips gruff
267+
```
268+
269+
Then generate the benchmark report:
270+
271+
```bash
272+
rake benchmark
273+
```
274+
275+
The benchmark script can be found [here](./benchmark/benchmark.rb).
269276

270277
## Limitations and Known Issues
271278

graphql-groups.gemspec

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,7 @@ Gem::Specification.new do |spec|
3333

3434
spec.required_ruby_version = Gem::Requirement.new('>= 3.3.0')
3535

36-
spec.add_development_dependency 'activerecord', '~> 7.2'
37-
spec.add_development_dependency 'benchmark-ips', '~> 2.8'
38-
spec.add_development_dependency 'bundler', '~> 2.0'
39-
spec.add_development_dependency 'database_cleaner-active_record', '~> 2.1'
40-
spec.add_development_dependency 'gqli', '~> 1.0'
41-
spec.add_development_dependency 'groupdate', '~> 6.5.1'
42-
spec.add_development_dependency 'rake', '~> 13.0'
43-
spec.add_development_dependency 'rspec', '~> 3.0'
44-
spec.add_development_dependency 'rubocop', '~> 0.88'
45-
spec.add_development_dependency 'rubocop-rspec', '~> 1.42'
46-
spec.add_development_dependency 'simplecov', '~> 0.22'
47-
spec.add_development_dependency 'sqlite3', '~> 2.1.1'
36+
spec.add_development_dependency 'rake', '~> 13.3'
4837

4938
spec.add_dependency 'graphql', '> 1.9'
5039
end

0 commit comments

Comments
 (0)