Releases: makoni/couchdb-swift
Releases · makoni/couchdb-swift
2.1.0
Changed
- Renamed the library from
couchdb-vapor
tocouchdb-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 theHTTPClient
. - Additional tests to ensure compatibility with custom
HTTPClient
instances and the newshutdown()
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
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 }
- Changed
- 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 }
- Enhanced error models to conform to
- 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? }
- Updated response models to conform to
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
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 }
- Changed
- 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 }
- Enhanced error models to conform to
- 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? }
- Updated response models to conform to
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
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 }
- Changed
- 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 }
- Enhanced error models to conform to
- 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? }
- Updated response models to conform to
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
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
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
1.6.0
1.5.1
1.5.0
- 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 inasync-http-client
1.21.0) internally for requests if noEventLoopGroup
is provided. - No more internal calls for
httpClient.syncShutdown()
in case ofHTTPClient.shared
usage.
Full Changelog: 1.4.0...1.5.0