Skip to content

Conversation

makoni
Copy link
Owner

@makoni makoni commented Jul 26, 2025

Major Features & Enhancements

  • Advanced Mango Queries Support

    • Introduced a robust and type-safe MangoQuery API for building complex selectors, projections, sorting, and pagination in CouchDB.
    • Added support for specifying indexes via useIndex in queries to optimize performance.
  • Attachments API

    • Added first-class support for uploading, downloading, and deleting document attachments (files/images).
    • Comprehensive Attachments API test suite ensures reliability for file operations.
  • Index Management

    • Added models and API for creating, listing, and managing Mango indexes (MangoIndex, IndexDefinition).
    • Tutorial and code samples for creating indexes are now included in documentation.
  • Query Explain

    • Added support for CouchDB Mango _explain endpoint via MangoExplainResponse to inspect how queries are executed and which indexes are used.

Documentation

  • Expanded README with:
    • Feature list
    • Usage examples for Attachments API and Mango queries
    • Supported platforms and Swift versions
    • Testing instructions
  • Added new in-code tutorials on:
    • Advanced Mango Queries (selectors, sorting, projections, index usage)
    • Creating Mango indexes

Testing

  • New test suites for:
    • Attachments API (upload, download, delete, and database setup/teardown)
    • MangoQuery encoding/decoding, MangoIndex encoding, MangoValue decoding
    • End-to-end index creation, listing, and query explain
  • Improved error handling tests for document CRUD operations and database creation

Breaking Changes

  • Mango Queries API

    • The find method now expects a MangoQuery instead of a generic selector dictionary.
    • Sort and projection parameters are now passed via MangoQuery.
  • Tests

    • Existing tests for Mango queries have been refactored to use the new type-safe API.

Miscellaneous

  • Various internal refactorings and improved error handling for database and document operations.
  • Updated documentation links and structure for clarity.
  • License explicitly stated in README.

Upgrade Notes:
If you use Mango queries or attachments, please update your code to use the new MangoQuery, MangoIndex, and attachment API signatures as shown in the updated documentation and code samples. For Swift 6+, enjoy strict concurrency and actor-based client; for Swift 5.x, use version 1.7.0.

@makoni makoni requested a review from Copilot July 26, 2025 20:34
Copilot

This comment was marked as outdated.

@makoni makoni requested a review from Copilot July 26, 2025 20:49
Copilot

This comment was marked as outdated.

@makoni makoni requested a review from Copilot July 26, 2025 21:01
Copilot

This comment was marked as outdated.

@makoni makoni requested a review from Copilot July 26, 2025 21:10
Copilot

This comment was marked as outdated.

@makoni makoni requested a review from Copilot July 27, 2025 05:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces version 2.2.0 with comprehensive improvements to the CouchDB Swift client library, focusing on advanced Mango queries, attachments API, and index management capabilities.

  • Advanced Mango queries with type-safe selectors, comparisons, sorting, and projection support
  • Complete attachments API for uploading, downloading, and deleting binary files
  • Index management functionality with creation, listing, and query explanation capabilities

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Sources/CouchDBClient/Models/MangoQuery.swift New models for type-safe Mango query construction with selectors, sorting, and pagination
Sources/CouchDBClient/Models/MangoIndex.swift Index definition and management models with creation/listing response types
Sources/CouchDBClient/Models/MangoExplainResponse.swift Query execution plan response model for optimization analysis
Sources/CouchDBClient/CouchDBClient.swift Enhanced client with new find method, index operations, and complete attachments API
Tests/CouchDBClientTests/MangoQueryTests.swift Comprehensive test suite for Mango query encoding/decoding functionality
Tests/CouchDBClientTests/AttachmentsAPITests.swift Full test coverage for attachment operations with binary data handling
Tests/CouchDBClientTests/CouchDBClientTests.swift Updated tests using new MangoQuery API and additional error handling scenarios
Documentation files New tutorials and updated documentation for advanced query features
README.md Enhanced documentation with feature list, usage examples, and platform support details

@makoni makoni merged commit 2b361b7 into master Jul 27, 2025
5 checks passed
@makoni makoni changed the title 2.2.0 2.3.0 Jul 27, 2025
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.

2 participants