Skip to content

Conversation

@vishesh
Copy link
Contributor

@vishesh vishesh commented Sep 4, 2025

Instead of relying on NIO and Foundation library for various asynchronous computation, we use the new async/await key words, Swift actor features and new testing library to simplify the implementation as well as API.

Instead of relying on NIO and Foundation library for various asynchronous computation, we use the
new async/await key words, Swift actor features and new testing library to simplify the
implementation as well as API.
@jzhou77 jzhou77 merged commit 2b92d73 into FoundationDB:main Sep 11, 2025
1amageek added a commit to 1amageek/fdb-swift-bindings that referenced this pull request Nov 8, 2025
Remove manual implementations of Equatable and Hashable in Versionstamp
and Subspace. The compiler can synthesize these conformances automatically
since all stored properties already conform to these protocols.

This improves code maintainability and follows Swift best practices.

Addresses: glbrntt review comment FoundationDB#2
1amageek added a commit to 1amageek/fdb-swift-bindings that referenced this pull request Nov 8, 2025
1. Use TupleTypeCode enum in switch statements for type safety
   Convert raw UInt8 type code to TupleTypeCode enum before switching.
   This provides compile-time safety and makes the code more maintainable.

2. Rename encode/decode to pack/unpack for cross-language consistency
   All official FoundationDB bindings use pack/unpack terminology:
   - Python: tuple.pack() / tuple.unpack()
   - Java: Tuple.pack() / Tuple.fromBytes()
   - Go: Tuple.Pack() / Tuple.Unpack()

   Using pack/unpack:
   - Matches established FDB terminology ("tuple packing")
   - Avoids confusion with Swift's Codable encode/decode
   - Improves searchability and documentation consistency

   API changes:
   - Tuple.encode() → Tuple.pack()
   - Tuple.decode(from:) → Tuple.unpack(from:)
   - Subspace methods already used pack/unpack (no change)

Addresses: glbrntt review comment FoundationDB#9, MMcM review comment FoundationDB#2
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