Merged
Conversation
Owner
kholdrex
commented
Aug 30, 2025
- Add aggregation methods (count, sum, avg, min, max)
- Add statistical functions (variance, stddev)
- Add database-specific group_concat function
- Add advanced stats() method for comprehensive column statistics
- Add custom_aggregation() for custom SQL aggregations
- Add convenient alias support for all aggregation methods
- Add automatic alias sanitization for complex column names
- Integrate aggregations seamlessly with existing query DSL
- Add comprehensive test suite for all aggregation features
- Update documentation with aggregation examples
- Update RBS type definitions for new methods
- Add aggregation methods (count, sum, avg, min, max) - Add statistical functions (variance, stddev) - Add database-specific group_concat function - Add advanced stats() method for comprehensive column statistics - Add custom_aggregation() for custom SQL aggregations - Add convenient alias support for all aggregation methods - Add automatic alias sanitization for complex column names - Integrate aggregations seamlessly with existing query DSL - Add comprehensive test suite for all aggregation features - Update documentation with aggregation examples - Update RBS type definitions for new methods
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive aggregation support to SimpleQuery, enhancing the library with database-level aggregation functions that provide better performance and developer experience compared to loading full record sets for calculations.
Key changes:
- Implements basic aggregation methods (count, sum, avg, min, max) and statistical functions (variance, stddev, group_concat)
- Adds advanced aggregation features including a
statsmethod for comprehensive column statistics and custom aggregation support - Integrates aggregations seamlessly with the existing query DSL, allowing chaining with other query methods
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lib/simple_query/clauses/aggregation_clause.rb |
Core aggregation functionality with database-specific implementations |
lib/simple_query/builder.rb |
Integration of aggregations into the main query builder with fluent interface |
spec/simple_query/clauses/aggregation_clause_spec.rb |
Comprehensive test coverage for aggregation clause functionality |
spec/simple_query/builder_spec.rb |
Integration tests for aggregation methods within the query builder |
sig/simple_query.rbs |
Type definitions for new aggregation methods |
lib/simple_query.rb |
Module loading for the new aggregation clause |
README.md |
Documentation updates with aggregation examples and usage guide |
CHANGELOG.md |
Release notes detailing the new aggregation features |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.