Skip to content
Merged

V1 #3

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
a95271e
Preparing for 1.0.0.rc1
stevegeek Aug 8, 2023
fdef33c
Update changelog
stevegeek Aug 8, 2023
241aef7
Starting to experiment with making Quo::Query a Literal::Struct
stevegeek Sep 28, 2023
a766193
Merge branch 'typed_attributes' into v1
stevegeek Feb 16, 2024
79d0316
Merge branch 'operation' into v1
stevegeek Feb 16, 2024
9289f86
Merge branch 'main' into v1
stevegeek Sep 4, 2024
3569923
Update literal and use new prop method
stevegeek Sep 4, 2024
28d4af6
WrappedQuery.wrap creates a new query class that adds props and wraps…
stevegeek Sep 4, 2024
1a74b47
Introduce ComposedQuery which replaces merged query and query compose…
stevegeek Sep 4, 2024
afc97c1
More explicit naming of .merge and fixes
stevegeek Sep 4, 2024
5490304
Loaded query creation with .wrap instead of overiding initializer
stevegeek Sep 4, 2024
1d78a75
Fixes to Query base class, but still some hacks to iron out
stevegeek Sep 4, 2024
176d8c7
Update changelog
stevegeek Sep 4, 2024
1e78a48
Use appraisals
stevegeek Sep 4, 2024
93b428b
Lint with standard
stevegeek Sep 4, 2024
5793b94
Fix gemfile
stevegeek Sep 4, 2024
8900cca
File needed in dummy app to test versus Rails 6.1
stevegeek Sep 4, 2024
c061277
Drop support for 6.1 , EOL in a month anyway
stevegeek Sep 4, 2024
1d67ec5
Migrate quo to be a Rails Engine, change config to use more standard …
stevegeek Sep 17, 2024
3524a24
Make #count more compatible with certain underlying queries
stevegeek Sep 18, 2024
3479104
First pass at migrating RBS sigs to inline RBS
stevegeek Sep 18, 2024
3d2ad47
Tweak to required ruby version
stevegeek Sep 24, 2024
13a9a1d
Fixes to composing queries, and a method was shadowed. Adds more test…
stevegeek Sep 24, 2024
ca59ed1
LoadedQuery and EagerQuery stepped on each others feet. Unify them as…
stevegeek Sep 24, 2024
6071fb9
Get rid of the confusing "eager" terminology as it didnt align with A…
stevegeek Sep 24, 2024
a6c1bd4
Remove options[]
stevegeek Sep 24, 2024
288d88b
Add test helpers for minitest
stevegeek Sep 25, 2024
6b4746a
Better handling of attempt at merging instances with class merge method
stevegeek Sep 25, 2024
cda14df
#offset should be public
stevegeek Sep 25, 2024
717adf8
Tweaking result predecates
stevegeek Sep 25, 2024
8b0b3d7
Use #size in collection backed queries
stevegeek Sep 25, 2024
be1b713
Forgot the method alias
stevegeek Sep 25, 2024
ef1d140
Do not delegate a ton of methods to results, reduce API surface of Query
stevegeek Sep 26, 2024
ff3e6df
Fix Results#exists?
stevegeek Sep 27, 2024
9181402
#to_collection should allow setting total_count
stevegeek Sep 27, 2024
d381691
A wrapped enurable in a CollectionBackedQuery should be defining the …
stevegeek Sep 30, 2024
c26e2f7
Lint and type updates
stevegeek Sep 30, 2024
c3deb31
Change preload config ivar
stevegeek Sep 30, 2024
4986b27
Dont use alias_method to make it easier to override methods in use
stevegeek Sep 30, 2024
b3d45f9
Support paginating in collections
stevegeek Oct 2, 2024
3a70f22
Implementing a simplified API of quo::query and more specific query c…
stevegeek Oct 4, 2024
f89defd
Rails should be in default 'dev' gemfile
stevegeek Oct 4, 2024
87526ed
Remove shadow check stuff
stevegeek Oct 4, 2024
e270b30
Improve inspect
stevegeek Oct 4, 2024
5d87e64
Fix bin/rails
stevegeek Oct 4, 2024
581bb23
Improve wrap methods
stevegeek Oct 4, 2024
8ce27bd
Check return value of query method
stevegeek Oct 4, 2024
bc5de63
Composed query test fixes
stevegeek Oct 4, 2024
be3b6db
Reuse base method
stevegeek Oct 4, 2024
e227343
Update RBS
stevegeek Oct 4, 2024
8fd4d31
Add to_s as inspect alias
stevegeek Oct 4, 2024
910886e
Fix compose to correctly merge any combinations that contains collect…
stevegeek Oct 4, 2024
926fae7
Instead of a configurable base class, you can specifty what class to …
stevegeek Oct 4, 2024
00b2f99
Fake queries should look and feel like real ones in test
stevegeek Oct 7, 2024
fe09507
Fix creation of fake
stevegeek Oct 7, 2024
f182c8d
Fakes use configured base classes
stevegeek Oct 7, 2024
1b9904f
Dont call back to query for total count
stevegeek Oct 7, 2024
36a0136
Rspec test helper too
stevegeek Oct 7, 2024
9617ee0
Oops, removed require by accident
stevegeek Oct 7, 2024
044077d
We should be building a new collection base class as configured
stevegeek Oct 8, 2024
765a419
Tweak to docs
stevegeek Oct 16, 2024
9f7d33c
Preparing for updated literal
stevegeek Mar 8, 2025
cd2589d
Bump to beta1
stevegeek Mar 8, 2025
3ff9674
Refactoring ComposedQuery
stevegeek Mar 8, 2025
5f64110
Experiment with simplifying relation backed query API and introducing…
stevegeek Mar 8, 2025
ba083ab
Also support the old style fluent API via delegation to specification
stevegeek Mar 8, 2025
97890b9
Updates to RBS
stevegeek Mar 8, 2025
fc0cb5a
Rename specification class to be more explicit
stevegeek Mar 8, 2025
e9cdd12
Test against rails 8
stevegeek Mar 9, 2025
2ef70bf
Latest literal required
stevegeek Mar 9, 2025
745630e
Update appraisals
stevegeek Mar 9, 2025
73fc05c
Add rails 8 gemfile
stevegeek Mar 9, 2025
189397c
Bump version requirement for literal
stevegeek Mar 10, 2025
18cfefe
Try update bundler
stevegeek Mar 10, 2025
6b67989
This combo?
stevegeek Mar 10, 2025
b67ffbc
Drop 3.1
stevegeek Mar 10, 2025
494095f
Support Rails 8
stevegeek Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
name: Ruby
name: main

on:
push:
branches:
- master

pull_request:
on: [push, pull_request]

jobs:
build:
tests:
name: Run tests for (${{ matrix.ruby }} / Rails ${{ matrix.rails }}
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
ruby:
- '3.1.2'

ruby: [ "3.2", "3.3", "3.4" ]
rails: [ "7.0", "7.1", "7.2", "8.0" ]
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install gems
run: |
gem install bundler
bundle install
bundle update --bundler
bundle exec appraisal install --jobs 4 --retry 3
- name: Run test
env:
MATRIX_RAILS_VERSION: ${{ matrix.rails }}
run: bundle exec appraisal rails-${MATRIX_RAILS_VERSION} rake test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Gemfile.lock
/.idea/
/.gem_rbs_collection/
rbs_collection.lock.yaml
*.gemfile.lock
5 changes: 4 additions & 1 deletion .standard.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# For available configuration options, see:
# https://github.com/testdouble/standard
ruby_version: 2.6
ruby_version: 3.4
ignore:
- "**/*":
- "Layout/LeadingCommentSpace"
15 changes: 15 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appraise "rails-7.0" do
gem "rails", "~> 7.0"
end

appraise "rails-7.1" do
gem "rails", "~> 7.1"
end

appraise "rails-7.2" do
gem "rails", "~> 7.2"
end

appraise "rails-8.0" do
gem "rails", "~> 8.0"
end
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,83 @@
## [Unreleased]


## [1.0.0.rc1] - Unreleased

### Breaking Changes

Nearly everything has had changes. Porting will require some effort.

- Quo now depends on `literal`, meaning attributes (options) to queries are typed and explicit
- Composing query objects now allows you to compose query classes rather than just instances of query objects
- `MergedQuery`, `EagerQuery` & `LoadedQuery` have been removed
- `Query` is now an abstract base class for `RelationBackedQuery` and `CollectionBackedQuery`
- The API of `Query` has been reduced/simplified significantly
- `Query` classes only build queries, to actually execute/take actions on them you need to call `#results` and get a `Results` object
- `preload`ing behaviour is now a separate concern from `Query` and is handled by `Preloadable` module.
- Drop support for Ruby <= 3.1 and Rails < 7.0
- Gem is now a Rails engine and relies on autoloading

### Changed

- Update docs, dependencies, and tests
- Use appraisals for testing

### Added

- Helpers `stub_query` and `mock_query` for Minitest

## [0.5.0] - 2022-12-23

### Changed

- Merged and Wrapped queries should not have factory methods as they are not meant to be constructed directly
- Create new LoadedQuery which separates the concern of "preloaded" Query from EagerQuery which represents a query which is loaded and memoized

## [0.4.0] - 2022-12-23

### Changed

- Some redundant nil checks (either safe navigation operator or conditionals) to make type check pass
- Fix for type of transform method which takes optional index as second arg
- group_by can take a block
- Change last and first methods to just take a limit value
- Add new configuration options for page size limit and default and fix typing for enumerable
- Rename Enumerator to Results and Query#enumerator to #results
- Change EagerQuery initializer to take collection as positional param

## [0.3.1] - 2022-12-22

### Changed

- Convenience methods on Query
- Implement group_by on enumerator to transform values in resulting groups
- Add WrappedQuery instead of Query taking a scope param
- Change `initialize` method of MergedQuery

## [0.3.0] - 2022-12-20

### Changed

- Make `joins` on compose a kwarg

## [0.2.0] - 2022-12-20

### Added

- Railtie for rake task
- Rake task which hackily looks for qo in the app and displays a list
- Prepare to add RBS types

### Changed

- Gem deps
- Query interface

### Added

- Test suite and dummy rails app
- Add Enumerator

## [0.1.0] - 2022-11-18

- Initial release
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ source "https://rubygems.org"
# Specify your gem's dependencies in quo.gemspec
gemspec

gem "rails", "~> 7.2"

group :development, :test do
gem "sqlite3"

gem "rails", ">= 6", "< 8"

gem "rake", "~> 13.0"

gem "minitest", "~> 5.0"

gem "standard", "~> 1.3"
gem "standard", require: false

gem "steep", require: false

gem "steep", "~> 1.2"
gem "rbs-inline", "~> 0.11.0", require: false
end
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Stephen Ierodiaconou
Copyright (c) 2022-2024 Stephen Ierodiaconou

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading