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
data/sig/quo/utilities/wrap.rbs
DELETED
data/sig/quo/wrapped_query.rbs
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
module Quo
|
2
|
-
class WrappedQuery < Quo::Query
|
3
|
-
def self.build_from_options: (**untyped options) -> WrappedQuery
|
4
|
-
|
5
|
-
@wrapped_query: ActiveRecord::Relation
|
6
|
-
|
7
|
-
def initialize: (ActiveRecord::Relation query, **untyped options) -> void
|
8
|
-
|
9
|
-
def query: () -> ActiveRecord::Relation
|
10
|
-
end
|
11
|
-
end
|
data/sig/quo.rbs
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
module ActiveRecord
|
2
|
-
module Associations
|
3
|
-
class Preloader
|
4
|
-
def initialize: (records: untyped, associations: untyped, ?scope: untyped, ?available_records: Array[untyped], ?associate_by_default: bool) -> void
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
module Quo
|
10
|
-
VERSION: String
|
11
|
-
|
12
|
-
type query = Quo::Query
|
13
|
-
type queryOrRel = query | ActiveRecord::Relation
|
14
|
-
type enumerable = Object & Enumerable[untyped]
|
15
|
-
type relOrEnumerable = ActiveRecord::Relation | enumerable
|
16
|
-
type loadedQueryOrEnumerable = LoadedQuery | EagerQuery | enumerable
|
17
|
-
type composable = query | relOrEnumerable
|
18
|
-
|
19
|
-
# TODO: how can we do the known options, eg `page` and then allow anything else?
|
20
|
-
# Maybe we should separate out the known options from the unknown options
|
21
|
-
type queryOptions = Hash[Symbol, untyped]
|
22
|
-
|
23
|
-
interface _Logger
|
24
|
-
def info: (String) -> void
|
25
|
-
def error: (String) -> void
|
26
|
-
def debug: (String) -> void
|
27
|
-
end
|
28
|
-
|
29
|
-
class Configuration
|
30
|
-
attr_accessor formatted_query_log: bool?
|
31
|
-
attr_accessor query_show_callstack_size: Integer?
|
32
|
-
attr_accessor logger: _Logger?
|
33
|
-
attr_accessor max_page_size: Integer?
|
34
|
-
attr_accessor default_page_size: Integer?
|
35
|
-
|
36
|
-
def initialize: () -> void
|
37
|
-
end
|
38
|
-
attr_reader self.configuration: Configuration
|
39
|
-
|
40
|
-
def self.configure: () { (Configuration config) -> void } -> void
|
41
|
-
end
|