quo 0.6.0 → 1.0.0.beta1
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/.standard.yml +4 -1
- data/Appraisals +15 -0
- data/CHANGELOG.md +78 -0
- data/Gemfile +6 -4
- data/LICENSE.txt +1 -1
- data/README.md +222 -232
- data/Steepfile +0 -2
- data/gemfiles/rails_7.0.gemfile +15 -0
- data/gemfiles/rails_7.1.gemfile +15 -0
- data/gemfiles/rails_7.2.gemfile +15 -0
- data/gemfiles/rails_8.0.gemfile +15 -0
- data/lib/quo/collection_backed_query.rb +87 -0
- data/lib/quo/collection_results.rb +44 -0
- data/lib/quo/composed_query.rb +278 -0
- data/lib/quo/engine.rb +11 -0
- data/lib/quo/minitest/helpers.rb +41 -0
- data/lib/quo/preloadable.rb +46 -0
- data/lib/quo/query.rb +97 -215
- data/lib/quo/relation_backed_query.rb +150 -0
- data/lib/quo/relation_backed_query_specification.rb +154 -0
- data/lib/quo/relation_results.rb +58 -0
- data/lib/quo/results.rb +48 -44
- data/lib/quo/rspec/helpers.rb +31 -9
- data/lib/quo/testing/collection_backed_fake.rb +29 -0
- data/lib/quo/testing/relation_backed_fake.rb +52 -0
- data/lib/quo/version.rb +3 -1
- data/lib/quo.rb +23 -30
- data/rbs_collection.yaml +0 -2
- data/sig/generated/quo/collection_backed_query.rbs +39 -0
- data/sig/generated/quo/collection_results.rbs +30 -0
- data/sig/generated/quo/composed_query.rbs +112 -0
- data/sig/generated/quo/engine.rbs +6 -0
- data/sig/generated/quo/preloadable.rbs +29 -0
- data/sig/generated/quo/query.rbs +98 -0
- data/sig/generated/quo/relation_backed_query.rbs +67 -0
- data/sig/generated/quo/relation_backed_query_specification.rbs +94 -0
- data/sig/generated/quo/relation_results.rbs +38 -0
- data/sig/generated/quo/results.rbs +39 -0
- data/sig/generated/quo/testing/collection_backed_fake.rbs +13 -0
- data/sig/generated/quo/testing/relation_backed_fake.rbs +23 -0
- data/sig/generated/quo/version.rbs +5 -0
- data/sig/generated/quo.rbs +9 -0
- data/sig/literal.rbs +7 -0
- metadata +77 -37
- data/lib/quo/eager_query.rb +0 -51
- data/lib/quo/loaded_query.rb +0 -18
- data/lib/quo/merged_query.rb +0 -36
- data/lib/quo/query_composer.rb +0 -78
- data/lib/quo/railtie.rb +0 -7
- data/lib/quo/utilities/callstack.rb +0 -21
- data/lib/quo/utilities/compose.rb +0 -18
- data/lib/quo/utilities/sanitize.rb +0 -19
- data/lib/quo/utilities/wrap.rb +0 -23
- data/lib/quo/wrapped_query.rb +0 -18
- data/sig/quo/eager_query.rbs +0 -15
- data/sig/quo/loaded_query.rbs +0 -7
- data/sig/quo/merged_query.rbs +0 -19
- data/sig/quo/query.rbs +0 -83
- data/sig/quo/query_composer.rbs +0 -32
- data/sig/quo/results.rbs +0 -22
- data/sig/quo/utilities/callstack.rbs +0 -7
- data/sig/quo/utilities/compose.rbs +0 -8
- data/sig/quo/utilities/sanitize.rbs +0 -9
- data/sig/quo/utilities/wrap.rbs +0 -11
- data/sig/quo/wrapped_query.rbs +0 -11
- data/sig/quo.rbs +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f72639830288de3776524bb1003fc88aeeee4d1adf83abeb44dd42e48caa0bfb
|
4
|
+
data.tar.gz: f72435e5e5ef3832bcf993362f0b56252bc17edaaedb197455308195c71f6516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64401d860bd1682d6b3d46d06f76eb644c9b3a3b1ad4d945b6d52b778d5deafe386f4588f9a7f381a8c484790711a3e0727f3d84f45469e8d53a787410741741
|
7
|
+
data.tar.gz: 5c148a23cc7ce4006fcac7c5cb9f6c118cbf08b35ea7b623743f48b3d36ae457d5902932a90669c5763e98db5df42b7ec31a470453752473821bc3e65ef7815d
|
data/.standard.yml
CHANGED
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,83 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
|
4
|
+
## [1.0.0.rc1] - Unreleased
|
5
|
+
|
6
|
+
### Breaking Changes
|
7
|
+
|
8
|
+
Nearly everything has had changes. Porting will require some effort.
|
9
|
+
|
10
|
+
- Quo now depends on `literal`, meaning attributes (options) to queries are typed and explicit
|
11
|
+
- Composing query objects now allows you to compose query classes rather than just instances of query objects
|
12
|
+
- `MergedQuery`, `EagerQuery` & `LoadedQuery` have been removed
|
13
|
+
- `Query` is now an abstract base class for `RelationBackedQuery` and `CollectionBackedQuery`
|
14
|
+
- The API of `Query` has been reduced/simplified significantly
|
15
|
+
- `Query` classes only build queries, to actually execute/take actions on them you need to call `#results` and get a `Results` object
|
16
|
+
- `preload`ing behaviour is now a separate concern from `Query` and is handled by `Preloadable` module.
|
17
|
+
- Drop support for Ruby <= 3.1 and Rails < 7.0
|
18
|
+
- Gem is now a Rails engine and relies on autoloading
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- Update docs, dependencies, and tests
|
23
|
+
- Use appraisals for testing
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- Helpers `stub_query` and `mock_query` for Minitest
|
28
|
+
|
29
|
+
## [0.5.0] - 2022-12-23
|
30
|
+
|
31
|
+
### Changed
|
32
|
+
|
33
|
+
- Merged and Wrapped queries should not have factory methods as they are not meant to be constructed directly
|
34
|
+
- Create new LoadedQuery which separates the concern of "preloaded" Query from EagerQuery which represents a query which is loaded and memoized
|
35
|
+
|
36
|
+
## [0.4.0] - 2022-12-23
|
37
|
+
|
38
|
+
### Changed
|
39
|
+
|
40
|
+
- Some redundant nil checks (either safe navigation operator or conditionals) to make type check pass
|
41
|
+
- Fix for type of transform method which takes optional index as second arg
|
42
|
+
- group_by can take a block
|
43
|
+
- Change last and first methods to just take a limit value
|
44
|
+
- Add new configuration options for page size limit and default and fix typing for enumerable
|
45
|
+
- Rename Enumerator to Results and Query#enumerator to #results
|
46
|
+
- Change EagerQuery initializer to take collection as positional param
|
47
|
+
|
48
|
+
## [0.3.1] - 2022-12-22
|
49
|
+
|
50
|
+
### Changed
|
51
|
+
|
52
|
+
- Convenience methods on Query
|
53
|
+
- Implement group_by on enumerator to transform values in resulting groups
|
54
|
+
- Add WrappedQuery instead of Query taking a scope param
|
55
|
+
- Change `initialize` method of MergedQuery
|
56
|
+
|
57
|
+
## [0.3.0] - 2022-12-20
|
58
|
+
|
59
|
+
### Changed
|
60
|
+
|
61
|
+
- Make `joins` on compose a kwarg
|
62
|
+
|
63
|
+
## [0.2.0] - 2022-12-20
|
64
|
+
|
65
|
+
### Added
|
66
|
+
|
67
|
+
- Railtie for rake task
|
68
|
+
- Rake task which hackily looks for qo in the app and displays a list
|
69
|
+
- Prepare to add RBS types
|
70
|
+
|
71
|
+
### Changed
|
72
|
+
|
73
|
+
- Gem deps
|
74
|
+
- Query interface
|
75
|
+
|
76
|
+
### Added
|
77
|
+
|
78
|
+
- Test suite and dummy rails app
|
79
|
+
- Add Enumerator
|
80
|
+
|
3
81
|
## [0.1.0] - 2022-11-18
|
4
82
|
|
5
83
|
- Initial release
|
data/Gemfile
CHANGED
@@ -5,16 +5,18 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in quo.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
+
gem "rails", "~> 7.2"
|
9
|
+
|
8
10
|
group :development, :test do
|
9
11
|
gem "sqlite3"
|
10
12
|
|
11
|
-
gem "rails", ">= 6", "< 8"
|
12
|
-
|
13
13
|
gem "rake", "~> 13.0"
|
14
14
|
|
15
15
|
gem "minitest", "~> 5.0"
|
16
16
|
|
17
|
-
gem "standard",
|
17
|
+
gem "standard", require: false
|
18
|
+
|
19
|
+
gem "steep", require: false
|
18
20
|
|
19
|
-
gem "
|
21
|
+
gem "rbs-inline", "~> 0.11.0", require: false
|
20
22
|
end
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2022 Stephen Ierodiaconou
|
3
|
+
Copyright (c) 2022-2025 Stephen Ierodiaconou
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|