Skip to content

Conversation

@vistart
Copy link
Contributor

@vistart vistart commented Apr 16, 2025

This pull request introduces comprehensive aggregate query features and related documentation improvements to the Python ActiveRecord project. The main changes include:

Change List

  • Aggregate Query Support

    • Implemented aggregate functions such as count, sum, avg, min, and max.
    • Added support for group by, having, and complex aggregation operations.
    • Introduced window functions and statistical queries.
    • Enhanced JSON operations within aggregate queries, including extraction, containment, and path existence checks.
    • Enabled custom expressions in aggregate queries (arithmetic, function, CASE, conditional, subquery, and grouping set expressions).
  • Documentation Updates

    • Expanded the documentation outline to include detailed sections for aggregate queries and their subtopics.
    • Added new markdown files describing aggregate query usage, JSON operations, and custom expressions.
    • Updated the table of contents to reflect new and reorganized documentation sections.
  • Other Improvements

    • Refactored query builder logic to support advanced aggregation and expression composition.
    • Improved test coverage for aggregate and statistical query scenarios.
    • Minor bug fixes and code style improvements related to query construction.

vistart added 10 commits April 12, 2025 18:27
Major changes:
- Improve SQLite RETURNING clause support with better version checks
- Add ReturningOptions class for advanced RETURNING clause configuration
- Add comprehensive join functionality including INNER, LEFT, RIGHT, FULL, CROSS joins
- Add support for MariaDB backend
- Update Pydantic version requirements and Python compatibility
- Add detailed documentation in Chinese and English

Technical details:
- Refactor SQLite backend to use hook methods for better extensibility
- Add type-safe join methods with support for aliases and conditions
- Improve error handling for database-specific cases
- Add comprehensive test coverage for join operations
- Update dependencies to support latest Pydantic features
- Fix SQLite compatibility issues with Python versions
…ng introduction, community, learning curve, and advanced features
… window functions, development process, security considerations, and application scenarios
…xamples

This commit improves the debugging techniques documentation by adding:
- Detailed logging configuration examples
- Query inspection methods using explain()
- Techniques for debugging complex queries and relationships
- Solutions for common issues like N+1 query problems
- Transaction and database connection troubleshooting
- Integration with Python debuggers and database tools
- Best practices for effective debugging

The documentation now provides more practical examples to help users identify and resolve issues in their ActiveRecord applications.
…ide usage examples for batch operations and cross-database transactions
This commit adds comprehensive documentation on how to integrate raw SQL queries with ActiveRecord when more control or specific database features are needed. The documentation covers:

- Using raw SQL in where conditions
- Incorporating raw SQL in join clauses
- Executing raw SQL queries directly
- Leveraging database-specific features
- Combining raw SQL with the query builder
- Using raw SQL for subqueries
- Best practices for raw SQL usage
- Security considerations

This documentation helps users understand when and how to safely use raw SQL while still benefiting from ActiveRecord's ORM capabilities.
Add detailed documentation about branch management and version release process:
- Define permanent branches (main and docs)
- Establish branch creation rules and naming conventions
- Outline version release process and CI requirements
- Explain documentation branch management workflow
…or MySQL and MariaDB

Updated multiple documentation files to add detailed configuration guides, data type mappings, storage engine support, transaction management, JSON support, and more for MySQL and MariaDB. These updates aim to provide developers with more comprehensive database support information and optimize the documentation structure for better readability.
@codecov
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.03%. Comparing base (7484576) to head (39732f0).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
- Coverage   79.28%   77.03%   -2.26%     
==========================================
  Files          41       42       +1     
  Lines        3708     4097     +389     
  Branches      621      698      +77     
==========================================
+ Hits         2940     3156     +216     
- Misses        576      733     +157     
- Partials      192      208      +16     
Flag Coverage Δ
python-3.10 76.78% <ø> (-2.13%) ⬇️
python-3.11 76.78% <ø> (-2.13%) ⬇️
python-3.12 76.78% <ø> (-2.13%) ⬇️
python-3.13 76.78% <ø> (-2.13%) ⬇️
python-3.8 76.94% <ø> (-2.23%) ⬇️
python-3.9 76.77% <ø> (-2.21%) ⬇️
unittests 77.00% <ø> (-2.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
19.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@vistart vistart merged commit 0452179 into main Apr 16, 2025
7 of 9 checks passed
@vistart vistart deleted the aggregate branch April 26, 2025 03:28
@vistart vistart restored the aggregate branch April 26, 2025 03:28
@vistart vistart deleted the aggregate branch April 26, 2025 03:28
@vistart vistart restored the aggregate branch May 17, 2025 15:00
@vistart vistart deleted the aggregate branch May 17, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant