@@ -60,26 +60,26 @@ protocol TransactionProtocol: Sendable {
6060 /// - snapshot: Whether to perform a snapshot read.
6161 /// - Returns: The value associated with the key, or nil if not found.
6262 /// - Throws: `FDBError` if the operation fails.
63- func getValue( for key: FDB . Key , snapshot: Bool ) async throws -> FDB . Value ?
63+ func getValue( for key: FDB . Bytes , snapshot: Bool ) async throws -> FDB . Bytes ?
6464
6565 /// Sets a value for the given key.
6666 ///
6767 /// - Parameters:
6868 /// - value: The value to set as a byte array.
6969 /// - key: The key to associate with the value.
70- func setValue( _ value: FDB . Value , for key: FDB . Key )
70+ func setValue( _ value: FDB . Bytes , for key: FDB . Bytes )
7171
7272 /// Removes a key-value pair from the database.
7373 ///
7474 /// - Parameter key: The key to remove as a byte array.
75- func clear( key: FDB . Key )
75+ func clear( key: FDB . Bytes )
7676
7777 /// Removes all key-value pairs in the given range.
7878 ///
7979 /// - Parameters:
8080 /// - beginKey: The start of the range (inclusive) as a byte array.
8181 /// - endKey: The end of the range (exclusive) as a byte array.
82- func clearRange( beginKey: FDB . Key , endKey: FDB . Key )
82+ func clearRange( beginKey: FDB . Bytes , endKey: FDB . Bytes )
8383
8484 /// Resolves a key selector to an actual key.
8585 ///
@@ -88,7 +88,7 @@ protocol TransactionProtocol: Sendable {
8888 /// - snapshot: Whether to perform a snapshot read.
8989 /// - Returns: The resolved key, or nil if no key matches.
9090 /// - Throws: `FDBError` if the operation fails.
91- func getKey( selector: FDB . Selectable , snapshot: Bool ) async throws -> FDB . Key ?
91+ func getKey( selector: FDB . Selectable , snapshot: Bool ) async throws -> FDB . Bytes ?
9292
9393 /// Resolves a key selector to an actual key.
9494 ///
@@ -97,7 +97,7 @@ protocol TransactionProtocol: Sendable {
9797 /// - snapshot: Whether to perform a snapshot read.
9898 /// - Returns: The resolved key, or nil if no key matches.
9999 /// - Throws: `FDBError` if the operation fails.
100- func getKey( selector: FDB . KeySelector , snapshot: Bool ) async throws -> FDB . Key ?
100+ func getKey( selector: FDB . KeySelector , snapshot: Bool ) async throws -> FDB . Bytes ?
101101
102102 /// Returns an AsyncSequence that yields key-value pairs within a range.
103103 ///
@@ -139,7 +139,7 @@ protocol TransactionProtocol: Sendable {
139139 /// - Returns: A `ResultRange` containing the key-value pairs and more flag.
140140 /// - Throws: `FDBError` if the operation fails.
141141 func getRangeNative(
142- beginKey: FDB . Key , endKey: FDB . Key , limit: Int , snapshot: Bool
142+ beginKey: FDB . Bytes , endKey: FDB . Bytes , limit: Int , snapshot: Bool
143143 ) async throws -> ResultRange
144144
145145 /// Commits the transaction.
@@ -159,7 +159,7 @@ protocol TransactionProtocol: Sendable {
159159 ///
160160 /// - Returns: The transaction's versionstamp as a key, or nil if not available.
161161 /// - Throws: `FDBError` if the operation fails.
162- func getVersionstamp( ) async throws -> FDB . Key ?
162+ func getVersionstamp( ) async throws -> FDB . Bytes ?
163163
164164 /// Sets the read version for snapshot reads.
165165 ///
@@ -191,7 +191,7 @@ protocol TransactionProtocol: Sendable {
191191 /// - endKey: The end of the range (exclusive).
192192 /// - Returns: The estimated size in bytes.
193193 /// - Throws: `FDBError` if the operation fails.
194- func getEstimatedRangeSizeBytes( beginKey: FDB . Key , endKey: FDB . Key ) async throws -> Int
194+ func getEstimatedRangeSizeBytes( beginKey: FDB . Bytes , endKey: FDB . Bytes ) async throws -> Int
195195
196196 /// Returns a list of keys that can split the given range into roughly equal chunks.
197197 ///
@@ -203,7 +203,7 @@ protocol TransactionProtocol: Sendable {
203203 /// - chunkSize: The desired size of each chunk in bytes.
204204 /// - Returns: An array of keys representing split points.
205205 /// - Throws: `FDBError` if the operation fails.
206- func getRangeSplitPoints( beginKey: FDB . Key , endKey: FDB . Key , chunkSize: Int ) async throws -> [ [ UInt8 ] ]
206+ func getRangeSplitPoints( beginKey: FDB . Bytes , endKey: FDB . Bytes , chunkSize: Int ) async throws -> [ [ UInt8 ] ]
207207
208208 /// Returns the version number at which a committed transaction modified the database.
209209 ///
@@ -228,7 +228,7 @@ protocol TransactionProtocol: Sendable {
228228 /// - key: The key to operate on.
229229 /// - param: The parameter for the atomic operation.
230230 /// - mutationType: The type of atomic operation to perform.
231- func atomicOp( key: FDB . Key , param: FDB . Value , mutationType: FDB . MutationType )
231+ func atomicOp( key: FDB . Bytes , param: FDB . Bytes , mutationType: FDB . MutationType )
232232
233233 /// Adds a conflict range to the transaction.
234234 ///
@@ -240,7 +240,7 @@ protocol TransactionProtocol: Sendable {
240240 /// - endKey: The end of the range (exclusive) as a byte array.
241241 /// - type: The type of conflict range (read or write).
242242 /// - Throws: `FDBError` if the operation fails.
243- func addConflictRange( beginKey: FDB . Key , endKey: FDB . Key , type: FDB . ConflictRangeType ) throws
243+ func addConflictRange( beginKey: FDB . Bytes , endKey: FDB . Bytes , type: FDB . ConflictRangeType ) throws
244244
245245 // MARK: - Transaction option methods
246246
@@ -250,7 +250,7 @@ protocol TransactionProtocol: Sendable {
250250 /// - value: Optional byte array value for the option.
251251 /// - option: The transaction option to set.
252252 /// - Throws: `FDBError` if the option cannot be set.
253- func setOption( to value: FDB . Value ? , forOption option: FDB . TransactionOption ) throws
253+ func setOption( to value: FDB . Bytes ? , forOption option: FDB . TransactionOption ) throws
254254
255255 /// Sets a transaction option with a string value.
256256 ///
@@ -313,15 +313,15 @@ extension DatabaseProtocol {
313313}
314314
315315extension TransactionProtocol {
316- public func getValue( for key: FDB . Key , snapshot: Bool = false ) async throws -> FDB . Value ? {
316+ public func getValue( for key: FDB . Bytes , snapshot: Bool = false ) async throws -> FDB . Bytes ? {
317317 try await getValue ( for: key, snapshot: snapshot)
318318 }
319319
320- public func getKey( selector: FDB . Selectable , snapshot: Bool = false ) async throws -> FDB . Key ? {
320+ public func getKey( selector: FDB . Selectable , snapshot: Bool = false ) async throws -> FDB . Bytes ? {
321321 try await getKey ( selector: selector. toKeySelector ( ) , snapshot: snapshot)
322322 }
323323
324- public func getKey( selector: FDB . KeySelector , snapshot: Bool = false ) async throws -> FDB . Key ? {
324+ public func getKey( selector: FDB . KeySelector , snapshot: Bool = false ) async throws -> FDB . Bytes ? {
325325 try await getKey ( selector: selector, snapshot: snapshot)
326326 }
327327
@@ -354,8 +354,9 @@ extension TransactionProtocol {
354354 )
355355 }
356356
357+
357358 public func getRange(
358- beginKey: FDB . Key , endKey: FDB . Key , snapshot: Bool = false
359+ beginKey: FDB . Bytes , endKey: FDB . Bytes , snapshot: Bool = false
359360 ) -> FDB . AsyncKVSequence {
360361 let beginSelector = FDB . KeySelector. firstGreaterOrEqual ( beginKey)
361362 let endSelector = FDB . KeySelector. firstGreaterOrEqual ( endKey)
0 commit comments