Skip to content

Releases: makoni/couchdb-swift

2.1.0

16 Apr 06:11
1f416b0
Compare
Choose a tag to compare

Changed

  • Renamed the library from couchdb-vapor to couchdb-swift to better reflect its purpose as a general CouchDB client for Swift, beyond Vapor-specific use cases.
  • Updated all references to the repository URL, badges, and package imports to align with the new name (couchdb-swift).
  • Enhanced documentation for clarity and consistency, including better descriptions for initialization, features, and usage examples.

Added

  • New Tutorial: Introduced a dedicated tutorial for integrating CouchDBClient with the Hummingbird server-side framework.
  • Added support for providing a custom HTTPClient during initialization, offering more flexibility for advanced use cases.
  • New method shutdown() added to properly release resources associated with the HTTPClient.
  • Additional tests to ensure compatibility with custom HTTPClient instances and the new shutdown() method.

Improved

  • Refactored the internal handling of HTTPClient to simplify its creation and management, reducing redundancy across methods.
  • Expanded feature documentation in CouchDBClient.docc to include detailed examples and step-by-step instructions for various use cases.

Fixed

  • Minor inconsistencies in documentation and error-handling tutorials.
  • Improved error messages for better debugging and clarity.

2.0.2

08 Apr 18:49
7554fde
Compare
Choose a tag to compare

Version 2.0.2

  • Added translations for error messages.

Version 2.0.1

This release significantly enhances the codebase by introducing support for Swift 6.0, adopting Swift Concurrency, updating dependencies, and improving overall code quality and documentation.

Major Updates

  • Swift Tool Version Update: Updated the minimum required Swift tools version to 6.0.
    - // swift-tools-version:5.8
    + // swift-tools-version:6.0

Documentation Updates

  • README:
    • Enhanced documentation for concurrency and compatibility with both Swift and Vapor versions.
    • Improved initialization examples and added instructions for avoiding hardcoded passwords.
    • Revised usage examples to reflect new API changes.

Codebase Enhancements

  • CouchDBClient: Updated to be an actor.
  • Client Initialization: Introduced a new configuration struct CouchDBClient.Config for cleaner initialization.
    let config = CouchDBClient.Config(
        couchProtocol: .http,
        couchHost: "127.0.0.1",
        couchPort: 5984,
        userName: "admin",
        userPassword: "yourPassword"
    )
    let couchDBClient = CouchDBClient(config: config)

Models and Protocol Updates

  • CouchDBRepresentable:
    • Changed _id to a non-optional property and added methods for updating document revisions.
    • Conformance to Sendable for thread safety.
    public protocol CouchDBRepresentable: Codable, Sendable {
        var _id: String { get }
        var _rev: String? { get }
        func updateRevision(_ newRevision: String) -> Self
    }
  • Error Handling:
    • Enhanced error models to conform to Sendable and added detailed documentation.
    public struct CouchDBError: Error, Codable, Sendable {
        public let error: String
        public let reason: String
    }
  • Responses:
    • Updated response models to conform to Sendable and added detailed documentation for properties.
    public struct CouchDBFindResponse<T: CouchDBRepresentable>: Codable, Sendable {
        let docs: [T]
        let bookmark: String?
    }

Test Updates

  • Unit Tests:
    • Updated tests to align with the new client initialization and document handling methods.
    struct ExpectedDoc: CouchDBRepresentable {
        var name: String
        var _id: String = NSUUID().uuidString
        var _rev: String?
        func updateRevision(_ newRevision: String) -> Self {
            return ExpectedDoc(name: name, _id: _id, _rev: newRevision)
        }
    }

Miscellaneous

  • Code Cleanup:
    • Removed unused imports and redundant code.
    • Improved code formatting and added missing documentation.

2.0.1

31 Mar 19:27
fb6e880
Compare
Choose a tag to compare

Version 2.0.1

This release significantly enhances the codebase by introducing support for Swift 6.0, adopting Swift Concurrency, updating dependencies, and improving overall code quality and documentation.

Major Updates

  • Swift Tool Version Update: Updated the minimum required Swift tools version to 6.0.
    - // swift-tools-version:5.8
    + // swift-tools-version:6.0

Documentation Updates

  • README:
    • Enhanced documentation for concurrency and compatibility with both Swift and Vapor versions.
    • Improved initialization examples and added instructions for avoiding hardcoded passwords.
    • Revised usage examples to reflect new API changes.

Codebase Enhancements

  • CouchDBClient: Updated to be an actor.
  • Client Initialization: Introduced a new configuration struct CouchDBClient.Config for cleaner initialization.
    let config = CouchDBClient.Config(
        couchProtocol: .http,
        couchHost: "127.0.0.1",
        couchPort: 5984,
        userName: "admin",
        userPassword: "yourPassword"
    )
    let couchDBClient = CouchDBClient(config: config)

Models and Protocol Updates

  • CouchDBRepresentable:
    • Changed _id to a non-optional property and added methods for updating document revisions.
    • Conformance to Sendable for thread safety.
    public protocol CouchDBRepresentable: Codable, Sendable {
        var _id: String { get }
        var _rev: String? { get }
        func updateRevision(_ newRevision: String) -> Self
    }
  • Error Handling:
    • Enhanced error models to conform to Sendable and added detailed documentation.
    public struct CouchDBError: Error, Codable, Sendable {
        public let error: String
        public let reason: String
    }
  • Responses:
    • Updated response models to conform to Sendable and added detailed documentation for properties.
    public struct CouchDBFindResponse<T: CouchDBRepresentable>: Codable, Sendable {
        let docs: [T]
        let bookmark: String?
    }

Test Updates

  • Unit Tests:
    • Updated tests to align with the new client initialization and document handling methods.
    struct ExpectedDoc: CouchDBRepresentable {
        var name: String
        var _id: String = NSUUID().uuidString
        var _rev: String?
        func updateRevision(_ newRevision: String) -> Self {
            return ExpectedDoc(name: name, _id: _id, _rev: newRevision)
        }
    }

Miscellaneous

  • Code Cleanup:
    • Removed unused imports and redundant code.
    • Improved code formatting and added missing documentation.

2.0.0

31 Mar 17:35
be3176b
Compare
Choose a tag to compare

Version 2.0.0

This release significantly enhances the codebase by introducing support for Swift 6.0, adopting Swift Concurrency, updating dependencies, and improving overall code quality and documentation.

Major Updates

  • Swift Tool Version Update: Updated the minimum required Swift tools version to 6.0.
    - // swift-tools-version:5.8
    + // swift-tools-version:6.0

Documentation Updates

  • README:
    • Enhanced documentation for concurrency and compatibility with both Swift and Vapor versions.
    • Improved initialization examples and added instructions for avoiding hardcoded passwords.
    • Revised usage examples to reflect new API changes.

Codebase Enhancements

  • CouchDBClient: Updated to be an actor.
  • Client Initialization: Introduced a new configuration struct CouchDBClient.Config for cleaner initialization.
    let config = CouchDBClient.Config(
        couchProtocol: .http,
        couchHost: "127.0.0.1",
        couchPort: 5984,
        userName: "admin",
        userPassword: "yourPassword"
    )
    let couchDBClient = CouchDBClient(config: config)

Models and Protocol Updates

  • CouchDBRepresentable:
    • Changed _id to a non-optional property and added methods for updating document revisions.
    • Conformance to Sendable for thread safety.
    public protocol CouchDBRepresentable: Codable, Sendable {
        var _id: String { get }
        var _rev: String? { get }
        func updateRevision(_ newRevision: String) -> Self
    }
  • Error Handling:
    • Enhanced error models to conform to Sendable and added detailed documentation.
    public struct CouchDBError: Error, Codable, Sendable {
        public let error: String
        public let reason: String
    }
  • Responses:
    • Updated response models to conform to Sendable and added detailed documentation for properties.
    public struct CouchDBFindResponse<T: CouchDBRepresentable>: Codable, Sendable {
        let docs: [T]
        let bookmark: String?
    }

Test Updates

  • Unit Tests:
    • Updated tests to align with the new client initialization and document handling methods.
    struct ExpectedDoc: CouchDBRepresentable {
        var name: String
        var _id: String = NSUUID().uuidString
        var _rev: String?
        func updateRevision(_ newRevision: String) -> Self {
            return ExpectedDoc(name: name, _id: _id, _rev: newRevision)
        }
    }

Miscellaneous

  • Code Cleanup:
    • Removed unused imports and redundant code.
    • Improved code formatting and added missing documentation.

1.7.0

13 Feb 06:58
8fc8702
Compare
Choose a tag to compare

What's Changed

  • Code formatting with swift-format.
  • Removed old deprecated methods.
  • Updated dependencies to latest versions.

Full Changelog: 1.6.2...1.7.0

1.6.2

19 Sep 20:09
21cbfc6
Compare
Choose a tag to compare

What's Changed

  • Updated swift-docc-plugin dependency URL.
  • Updated dependencies to the latest versions.

Full Changelog: 1.6.1...1.6.2

1.6.1

12 Jun 10:40
3909771
Compare
Choose a tag to compare

What's Changed

  • Updated dependencies to the most recent versions. by @makoni in #23

Full Changelog: 1.6.0...1.6.1

1.6.0

14 May 21:22
d04eee8
Compare
Choose a tag to compare
  • userName param is now required for CouchDBClient init.
  • Much better docs written by ChatGPT.

What's Changed

Full Changelog: 1.5.1...1.6.0

1.5.1

12 May 19:50
8a0647f
Compare
Choose a tag to compare

What's Changed

  • Documentation updated by @makoni in #19
  • Added a new tutorial for a SwiftUI app. No changes in the library code by @makoni in #20

Full Changelog: 1.5.0...1.5.1

1.5.0

08 Apr 14:56
380fe33
Compare
Choose a tag to compare
  • Bumped async-http-client minimum version to the new 1.21.0. If you can't use it in your project you can stay on 1.4.0.
  • The library will use HTTPClient.shared (new in async-http-client 1.21.0) internally for requests if no EventLoopGroup is provided.
  • No more internal calls for httpClient.syncShutdown() in case of HTTPClient.shared usage.

Full Changelog: 1.4.0...1.5.0