FdbTransactionExtensions
Namespace: FoundationDB.Client · class
Provides a set of extensions methods shared by all FoundationDB transaction implementations.
Methods
AddConflictRange
static void AddConflictRange(IFdbTransaction trans, KeyRange range, FdbConflictRangeType type)
Adds a conflict range to a transaction without performing the associated read or write.
trans— Transaction to use for the operationrange— Range of the keys specifying the conflict range. The end key is excludedtype— One of the FDBConflictRangeType values indicating what type of conflict range is being set.
static void AddConflictRange<TKeyRange>(IFdbTransaction trans, in TKeyRange range, FdbConflictRangeType type)
Adds a conflict range to a transaction without performing the associated read or write.
trans— Transaction to use for the operationrange— Range of the keys specifying the conflict range. The end key is excludedtype— One of the FDBConflictRangeType values indicating what type of conflict range is being set.
static void AddConflictRange(IFdbTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive, FdbConflictRangeType type)
Adds a conflict range to a transaction without performing the associated read or write.
trans— Transaction to use for the operationbeginKeyInclusive— Key specifying the beginning of the conflict range. The key is includedendKeyExclusive— Key specifying the end of the conflict range. The key is excludedtype— One of the FdbConflictRangeType values indicating what type of conflict range is being set.
static void AddConflictRange<TBeginKey>(IFdbTransaction trans, in TBeginKey beginKeyInclusive, ReadOnlySpan<byte> endKeyExclusive, FdbConflictRangeType type)
Adds a key to the transaction's read conflict ranges as if you had read the key. As a result, other transactions that write to this key could cause the transaction to fail with a conflict.
static void AddConflictRange<TEndKey>(IFdbTransaction trans, ReadOnlySpan<byte> beginKeyInclusive, in TEndKey endKeyExclusive, FdbConflictRangeType type)
Adds a key to the transaction's read conflict ranges as if you had read the key. As a result, other transactions that write to this key could cause the transaction to fail with a conflict.
static void AddConflictRange<TBeginKey, TEndKey>(IFdbTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive, FdbConflictRangeType type)
Adds a key to the transaction's read conflict ranges as if you had read the key. As a result, other transactions that write to this key could cause the transaction to fail with a conflict.
AddReadConflictKey
static void AddReadConflictKey(IFdbTransaction trans, Slice key)
Adds a key to the transaction's read conflict ranges as if you had read the key. As a result, other transactions that write to this key could cause the transaction to fail with a conflict.
static void AddReadConflictKey<TKey>(IFdbTransaction trans, in TKey key)
Adds a key to the transaction's read conflict ranges as if you had read the key. As a result, other transactions that write to this key could cause the transaction to fail with a conflict.
AddReadConflictRange
static void AddReadConflictRange<TKeyRange>(IFdbTransaction trans, in TKeyRange range)
Adds a range of keys to the transaction's read conflict ranges as if you had read the range. As a result, other transactions that write a key in this range could cause the transaction to fail with a conflict.
static void AddReadConflictRange(IFdbTransaction trans, KeyRange range)
Adds a range of keys to the transaction's read conflict ranges as if you had read the range. As a result, other transactions that write a key in this range could cause the transaction to fail with a conflict.
static void AddReadConflictRange(IFdbTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive)
Adds a range of keys to the transaction's read conflict ranges as if you had read the range. As a result, other transactions that write a key in this range could cause the transaction to fail with a conflict.
static void AddReadConflictRange<TBeginKey, TEndKey>(IFdbTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive)
Adds a range of keys to the transaction's read conflict ranges as if you had read the range. As a result, other transactions that write a key in this range could cause the transaction to fail with a conflict.
static void AddReadConflictRange(IFdbTransaction trans, ReadOnlySpan<byte> beginKeyInclusive, ReadOnlySpan<byte> endKeyExclusive)
Adds a range of keys to the transaction's read conflict ranges as if you had read the range. As a result, other transactions that write a key in this range could cause the transaction to fail with a conflict.
AddWriteConflictKey
static void AddWriteConflictKey(IFdbTransaction trans, Slice key)
Adds a key to the transaction's write conflict ranges as if you had cleared the key. As a result, other transactions that concurrently read this key could fail with a conflict.
static void AddWriteConflictKey<TKey>(IFdbTransaction trans, in TKey key)
Adds a key to the transaction's write conflict ranges as if you had cleared the key. As a result, other transactions that concurrently read this key could fail with a conflict.
AddWriteConflictRange
static void AddWriteConflictRange<TKeyRange>(IFdbTransaction trans, in TKeyRange range)
Adds a range of keys to the transaction's write conflict ranges as if you had cleared the range. As a result, other transactions that concurrently read a key in this range could fail with a conflict.
static void AddWriteConflictRange(IFdbTransaction trans, KeyRange range)
Adds a range of keys to the transaction's write conflict ranges as if you had cleared the range. As a result, other transactions that concurrently read a key in this range could fail with a conflict.
static void AddWriteConflictRange(IFdbTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive)
Adds a range of keys to the transaction's write conflict ranges as if you had cleared the range. As a result, other transactions that concurrently read a key in this range could fail with a conflict.
static void AddWriteConflictRange<TBeginKey, TEndKey>(IFdbTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive)
Adds a range of keys to the transaction's write conflict ranges as if you had cleared the range. As a result, other transactions that concurrently read a key in this range could fail with a conflict.
static void AddWriteConflictRange(IFdbTransaction trans, ReadOnlySpan<byte> beginKeyInclusive, ReadOnlySpan<byte> endKeyExclusive)
Adds a range of keys to the transaction's write conflict ranges as if you had cleared the range. As a result, other transactions that concurrently read a key in this range could fail with a conflict.
Atomic
static void Atomic(IFdbTransaction trans, Slice key, Slice param, FdbMutationType mutation)
Performs an atomic operation that will mutate a key in the database
key— Name of the key to be mutated in the database.param— Parameter with which the atomic operation will mutate the value associated withkey.mutation— Type of mutation that should be performed on the key
Modifies the database snapshot represented by this transaction to perform the operation indicated by mutation with operand param to the value stored by the given key.
static void Atomic<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue param, FdbMutationType mutation)
Performs an atomic operation that will mutate a key in the database
key— Name of the key to be mutated in the database.param— Parameter with which the atomic operation will mutate the value associated withkey.mutation— Type of mutation that should be performed on the key
Modifies the database snapshot represented by this transaction to perform the operation indicated by mutation with operand param to the value stored by the given key.
static void Atomic<TValue>(IFdbTransaction trans, ReadOnlySpan<byte> key, in TValue param, FdbMutationType mutation)
Performs an atomic operation that will mutate a key in the database
key— Name of the key to be mutated in the database.param— Parameter with which the atomic operation will mutate the value associated withkey.mutation— Type of mutation that should be performed on the key
Modifies the database snapshot represented by this transaction to perform the operation indicated by mutation with operand param to the value stored by the given key.
static void Atomic<TKey>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> param, FdbMutationType mutation)
Performs an atomic operation that will mutate a key in the database
key— Name of the key to be mutated in the database.param— Parameter with which the atomic operation will mutate the value associated withkey.mutation— Type of mutation that should be performed on the key
Modifies the database snapshot represented by this transaction to perform the operation indicated by mutation with operand param to the value stored by the given key.
AtomicAdd
static void AtomicAdd<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Modify the database snapshot represented by this transaction to add the value of value to the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to add to existing value of key.
static void AtomicAdd<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Modify the database snapshot represented by this transaction to add the value of value to the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to add to existing value of key.
static void AtomicAdd<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to add the value of value to the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to add to existing value of key.
static void AtomicAdd(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to add the value of value to the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to add to existing value of key.
AtomicAdd32
static void AtomicAdd32(IFdbTransaction trans, Slice key, int value)
Modify the database snapshot represented by this transaction to add a signed integer to the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 4 bytes in little-endian.
static void AtomicAdd32<TKey>(IFdbTransaction trans, in TKey key, int value)
Modify the database snapshot represented by this transaction to add a signed integer to the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 4 bytes in little-endian.
static void AtomicAdd32(IFdbTransaction trans, ReadOnlySpan<byte> key, int value)
Modify the database snapshot represented by this transaction to add a signed integer to the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 4 bytes in little-endian.
static void AtomicAdd32(IFdbTransaction trans, Slice key, uint value)
Modify the database snapshot represented by this transaction to add an unsigned integer to the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 4 bytes in little-endian.
static void AtomicAdd32<TKey>(IFdbTransaction trans, in TKey key, uint value)
Modify the database snapshot represented by this transaction to add an unsigned integer to the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 4 bytes in little-endian.
static void AtomicAdd32(IFdbTransaction trans, ReadOnlySpan<byte> key, uint value)
Modify the database snapshot represented by this transaction to add an unsigned integer to the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 4 bytes in little-endian.
AtomicAdd64
static void AtomicAdd64(IFdbTransaction trans, Slice key, long value)
Modify the database snapshot represented by this transaction to add a signed integer to the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 8 bytes in little-endian.
static void AtomicAdd64<TKey>(IFdbTransaction trans, in TKey key, long value)
Modify the database snapshot represented by this transaction to add a signed integer to the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 8 bytes in little-endian.
static void AtomicAdd64(IFdbTransaction trans, ReadOnlySpan<byte> key, long value)
Modify the database snapshot represented by this transaction to add a signed integer to the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 8 bytes in little-endian.
static void AtomicAdd64(IFdbTransaction trans, Slice key, ulong value)
Modify the database snapshot represented by this transaction to add an unsigned integer to the 64-bit value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 8 bytes in little-endian.
static void AtomicAdd64<TKey>(IFdbTransaction trans, in TKey key, ulong value)
Modify the database snapshot represented by this transaction to add an unsigned integer to the 64-bit value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 8 bytes in little-endian.
static void AtomicAdd64(IFdbTransaction trans, ReadOnlySpan<byte> key, ulong value)
Modify the database snapshot represented by this transaction to add an unsigned integer to the 64-bit value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Integer add to existing value of key. It will be encoded as 8 bytes in little-endian.
AtomicAnd
static void AtomicAnd<TValue>(IFdbTransaction trans, Slice key, in TValue mask)
Modify the database snapshot represented by this transaction to perform a bitwise AND between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicAnd<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue mask)
Modify the database snapshot represented by this transaction to perform a bitwise AND between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicAnd<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> mask)
Modify the database snapshot represented by this transaction to perform a bitwise AND between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicAnd(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> mask)
Modify the database snapshot represented by this transaction to perform a bitwise AND between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
AtomicAppendIfFits
static void AtomicAppendIfFits<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Modify the database snapshot represented by this transaction to append to a value, unless it would become larger that the maximum value size supported by the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to append.
static void AtomicAppendIfFits<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Modify the database snapshot represented by this transaction to append to a value, unless it would become larger that the maximum value size supported by the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to append.
static void AtomicAppendIfFits<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to append to a value, unless it would become larger that the maximum value size supported by the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to append.
static void AtomicAppendIfFits(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to append to a value, unless it would become larger that the maximum value size supported by the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value to append.
AtomicClearIfZero32
static void AtomicClearIfZero32(IFdbTransaction trans, Slice key)
Atomically clear the key only if its value is equal to 4 consecutive zero bytes.
trans— Transaction to use for the operationkey— Name of the key whose value is to be conditionally cleared.
This method requires API version 610 or greater.
static void AtomicClearIfZero32<TKey>(IFdbTransaction trans, in TKey key)
Atomically clear the key only if its value is equal to 4 consecutive zero bytes.
trans— Transaction to use for the operationkey— Name of the key whose value is to be conditionally cleared.
This method requires API version 610 or greater.
static void AtomicClearIfZero32(IFdbTransaction trans, ReadOnlySpan<byte> key)
Atomically clear the key only if its value is equal to 4 consecutive zero bytes.
trans— Transaction to use for the operationkey— Name of the key whose value is to be conditionally cleared.
This method requires API version 610 or greater.
AtomicClearIfZero64
static void AtomicClearIfZero64(IFdbTransaction trans, Slice key)
Atomically clear the key only if its value is equal to 8 consecutive zero bytes.
trans— Transaction to use for the operationkey— Name of the key whose value is to be conditionally cleared.
This method requires API version 610 or greater.
static void AtomicClearIfZero64<TKey>(IFdbTransaction trans, in TKey key)
Atomically clear the key only if its value is equal to 8 consecutive zero bytes.
trans— Transaction to use for the operationkey— Name of the key whose value is to be conditionally cleared.
This method requires API version 610 or greater.
static void AtomicClearIfZero64(IFdbTransaction trans, ReadOnlySpan<byte> key)
Atomically clear the key only if its value is equal to 8 consecutive zero bytes.
trans— Transaction to use for the operationkey— Name of the key whose value is to be conditionally cleared.
This method requires API version 610 or greater.
AtomicCompareAndClear
static void AtomicCompareAndClear<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue comparand)
Modify the database snapshot represented by this transaction to clear the value of key only if it is equal to comparand.
trans— Transaction to use for the operationkey— Name of the key whose value is to be cleared.comparand— Value that the key must have, in order to be cleared.
If the does not exist, or has a different value than then no changes will be performed. This method requires API version 610 or greater.
static void AtomicCompareAndClear<TKey>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> comparand)
Modify the database snapshot represented by this transaction to clear the value of key only if it is equal to comparand.
trans— Transaction to use for the operationkey— Name of the key whose value is to be cleared.comparand— Value that the key must have, in order to be cleared.
If the does not exist, or has a different value than then no changes will be performed. This method requires API version 610 or greater.
static void AtomicCompareAndClear(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> comparand)
Modify the database snapshot represented by this transaction to clear the value of key only if it is equal to comparand.
trans— Transaction to use for the operationkey— Name of the key whose value is to be cleared.comparand— Value that the key must have, in order to be cleared.
If the does not exist, or has a different value than then no changes will be performed. This method requires API version 610 or greater.
AtomicDecrement32
static void AtomicDecrement32(IFdbTransaction trans, Slice key)
Modify the database snapshot represented by this transaction to subtract 1 from the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicDecrement32<TKey>(IFdbTransaction trans, in TKey key)
Modify the database snapshot represented by this transaction to subtract 1 from the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicDecrement32(IFdbTransaction trans, ReadOnlySpan<byte> key)
Modify the database snapshot represented by this transaction to subtract 1 from the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicDecrement32(IFdbTransaction trans, Slice key, bool clearIfZero)
Modify the database snapshot represented by this transaction to subtract 1 from the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.clearIfZero— Iftrue, automatically clear the key if it reaches zero. Iffalse, the key can remain with a value of 0 in the database.
This method requires API version 610 or greater.
static void AtomicDecrement32(IFdbTransaction trans, ReadOnlySpan<byte> key, bool clearIfZero)
Modify the database snapshot represented by this transaction to subtract 1 from the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.clearIfZero— Iftrue, automatically clear the key if it reaches zero. Iffalse, the key can remain with a value of 0 in the database.
This method requires API version 610 or greater.
AtomicDecrement64
static void AtomicDecrement64(IFdbTransaction trans, Slice key)
Modify the database snapshot represented by this transaction to subtract 1 from the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicDecrement64<TKey>(IFdbTransaction trans, in TKey key)
Modify the database snapshot represented by this transaction to subtract 1 from the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicDecrement64(IFdbTransaction trans, ReadOnlySpan<byte> key)
Modify the database snapshot represented by this transaction to subtract 1 from the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicDecrement64(IFdbTransaction trans, Slice key, bool clearIfZero)
Modify the database snapshot represented by this transaction to subtract 1 from the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.clearIfZero— Iftrue, automatically clear the key if it reaches zero. Iffalse, the key can remain with a value of 0 in the database.
This method requires API version 610 or greater.
static void AtomicDecrement64<TKey>(IFdbTransaction trans, in TKey key, bool clearIfZero)
Modify the database snapshot represented by this transaction to subtract 1 from the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.clearIfZero— Iftrue, automatically clear the key if it reaches zero. Iffalse, the key can remain with a value of 0 in the database.
This method requires API version 610 or greater.
static void AtomicDecrement64(IFdbTransaction trans, ReadOnlySpan<byte> key, bool clearIfZero)
Modify the database snapshot represented by this transaction to subtract 1 from the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.clearIfZero— Iftrue, automatically clear the key if it reaches zero. Iffalse, the key can remain with a value of 0 in the database.
This method requires API version 610 or greater.
AtomicIncrement32
static void AtomicIncrement32(IFdbTransaction trans, Slice key)
Modify the database snapshot represented by this transaction to increment by 1 the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicIncrement32<TKey>(IFdbTransaction trans, in TKey key)
Modify the database snapshot represented by this transaction to increment by 1 the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicIncrement32(IFdbTransaction trans, ReadOnlySpan<byte> key)
Modify the database snapshot represented by this transaction to increment by 1 the 32-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
AtomicIncrement64
static void AtomicIncrement64<TKey>(IFdbTransaction trans, in TKey key)
Modify the database snapshot represented by this transaction to add 1 to the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicIncrement64(IFdbTransaction trans, Slice key)
Modify the database snapshot represented by this transaction to add 1 to the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
static void AtomicIncrement64(IFdbTransaction trans, ReadOnlySpan<byte> key)
Modify the database snapshot represented by this transaction to add 1 to the 64-bit little-endian value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.
AtomicMax
static void AtomicMax<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Modify the database snapshot represented by this transaction to update a value if it is larger than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
static void AtomicMax<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Modify the database snapshot represented by this transaction to update a value if it is larger than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
static void AtomicMax<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to update a value if it is larger than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
static void AtomicMax(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to update a value if it is larger than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
AtomicMin
static void AtomicMin<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Modify the database snapshot represented by this transaction to update a value if it is smaller than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
static void AtomicMin<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Modify the database snapshot represented by this transaction to update a value if it is smaller than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
static void AtomicMin<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to update a value if it is smaller than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
static void AtomicMin(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value)
Modify the database snapshot represented by this transaction to update a value if it is smaller than the value in the database.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Bit mask.
AtomicOr
static void AtomicOr<TValue>(IFdbTransaction trans, Slice key, in TValue mask)
Modify the database snapshot represented by this transaction to perform a bitwise OR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicOr<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue mask)
Modify the database snapshot represented by this transaction to perform a bitwise OR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicOr<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> mask)
Modify the database snapshot represented by this transaction to perform a bitwise OR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicOr(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> mask)
Modify the database snapshot represented by this transaction to perform a bitwise OR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
AtomicXor
static void AtomicXor<TValue>(IFdbTransaction trans, Slice key, in TValue mask)
Modify the database snapshot represented by this transaction to perform a bitwise XOR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicXor<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue mask)
Modify the database snapshot represented by this transaction to perform a bitwise XOR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicXor<TKey, TValue>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> mask)
Modify the database snapshot represented by this transaction to perform a bitwise XOR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
static void AtomicXor(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> mask)
Modify the database snapshot represented by this transaction to perform a bitwise XOR between mask and the value stored by the given key.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.mask— Bit mask.
CheckValueAsync
static Task<(FdbValueCheckResult, Slice)> CheckValueAsync(IFdbReadOnlyTransaction trans, Slice key, Slice expected)
Checks if the value from the database snapshot represented by the current transaction is equal to some expected value.
trans— Transaction to use for the operationkey— Key to be looked up in the databaseexpected— Expected value for this key
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<(FdbValueCheckResult, Slice)> CheckValueAsync<TKey>(IFdbReadOnlyTransaction trans, in TKey key, Slice expected)
static Task<(FdbValueCheckResult, Slice)> CheckValueAsync<TKey, TValue>(IFdbReadOnlyTransaction trans, in TKey key, in TValue expected)
Clear
static void Clear(IFdbTransaction trans, Slice key)
Removes a key from the database.
key— Name of the key to be removed from the database.
Modifies the database snapshot represented by this transaction to remove the given key from the database.
If the key was not previously present in the database, there is no effect.
static void Clear<TKey>(IFdbTransaction trans, in TKey key)
Removes a key from the database.
key— Name of the key to be removed from the database.
Modifies the database snapshot represented by this transaction to remove the given key from the database.
If the key was not previously present in the database, there is no effect.
ClearRange
static void ClearRange(IFdbTransaction trans, KeyRange range)
Modify the database snapshot represented by this transaction to remove all keys (if any) which are lexicographically greater than or equal to the given begin key and lexicographically less than the given end_key. Sets and clears affect the actual database only if transaction is later committed with CommitAsync().
trans— Transaction to use for the operationrange— Pair of keys defining the range to clear.
static void ClearRange<TKeyRange>(IFdbTransaction trans, in TKeyRange range)
static void ClearRange(IFdbTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive)
Removes a range of keys from the database.
beginKeyInclusive— Name of the key specifying the beginning of the range to clear.endKeyExclusive— Name of the key specifying the end of the range to clear.
Modifies the database snapshot represented by this transaction to remove all keys (if any) which are lexicographically greater than or equal to the given begin key and lexicographically less than the given end_key.
Sets and clears affect the actual database only if transaction is later committed with CommitAsync().
static void ClearRange<TBeginKey>(IFdbTransaction trans, in TBeginKey beginKeyInclusive, Slice endKeyExclusive)
Removes a range of keys from the database.
beginKeyInclusive— Name of the key specifying the beginning of the range to clear.endKeyExclusive— Name of the key specifying the end of the range to clear.
Modifies the database snapshot represented by this transaction to remove all keys (if any) which are lexicographically greater than or equal to the given begin key and lexicographically less than the given end_key.
Sets and clears affect the actual database only if transaction is later committed with CommitAsync().
static void ClearRange<TEndKey>(IFdbTransaction trans, Slice beginKeyInclusive, in TEndKey endKeyExclusive)
Removes a range of keys from the database.
beginKeyInclusive— Name of the key specifying the beginning of the range to clear.endKeyExclusive— Name of the key specifying the end of the range to clear.
Modifies the database snapshot represented by this transaction to remove all keys (if any) which are lexicographically greater than or equal to the given begin key and lexicographically less than the given end_key.
Sets and clears affect the actual database only if transaction is later committed with CommitAsync().
static void ClearRange<TBeginKey, TEndKey>(IFdbTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive)
Removes a range of keys from the database.
beginKeyInclusive— Name of the key specifying the beginning of the range to clear.endKeyExclusive— Name of the key specifying the end of the range to clear.
Modifies the database snapshot represented by this transaction to remove all keys (if any) which are lexicographically greater than or equal to the given begin key and lexicographically less than the given end_key.
Sets and clears affect the actual database only if transaction is later committed with CommitAsync().
GetAddressesForKeyAsync
static Task<string[]> GetAddressesForKeyAsync(IFdbReadOnlyTransaction trans, Slice key)
Returns a list of public network addresses as strings, one for each of the storage servers responsible for storing key and its associated value
key— Name of the key whose location is to be queried.
Returns: Task that will return an array of strings, or an exception
Depending on the API level or whether database option is set, the returned string may or may not include the port numbers
static Task<string[]> GetAddressesForKeyAsync<TKey>(IFdbReadOnlyTransaction trans, in TKey key)
Returns a list of public network addresses as strings, one for each of the storage servers responsible for storing key and its associated value
key— Name of the key whose location is to be queried.
Returns: Task that will return an array of strings, or an exception
Depending on the API level or whether database option is set, the returned string may or may not include the port numbers
GetAsync
static Task<Slice> GetAsync(IFdbReadOnlyTransaction trans, Slice key)
Reads a value from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<Slice> GetAsync<TKey>(IFdbReadOnlyTransaction trans, in TKey key)
Reads a value from the database snapshot represented by the current transaction.
key— Key to be looked up in the database
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<TResult> GetAsync<TKey, TResult>(IFdbReadOnlyTransaction trans, in TKey key, FdbValueDecoder<TResult> valueDecoder)
Reads a value from the database snapshot represented by the current transaction.
key— Key to be looked up in the databasevalueDecoder— Decoder that will extract the result from the value found in the database
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<TResult> GetAsync<TResult>(IFdbReadOnlyTransaction trans, Slice key, FdbValueDecoder<TResult> decoder)
Reads a value from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkey— Key to be looked up in the databasedecoder— Decoder that will extract the result from the value found in the database
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<TValue> GetAsync<TValue>(IFdbReadOnlyTransaction trans, Slice key, IValueEncoder<TValue> encoder)
Reads and decodes a value from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkey— Key to be looked up in the databaseencoder— Encoder used to decode the value of the key.
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<TValue> GetAsync<TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, IValueEncoder<TValue> encoder)
Reads and decodes a value from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkey— Key to be looked up in the databaseencoder— Encoder used to decode the value of the key.
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<TResult> GetAsync<TKey, TValueState, TResult>(IFdbReadOnlyTransaction trans, in TKey key, TValueState valueState, FdbValueDecoder<TValueState, TResult> valueDecoder)
Reads a value from the database snapshot represented by the current transaction.
key— Key to be looked up in the databasevalueState— State that will be forwarded to thevalueDecodervalueDecoder— Decoder that will extract the result from the value found in the database
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
static Task<TResult> GetAsync<TState, TResult>(IFdbReadOnlyTransaction trans, Slice key, TState state, FdbValueDecoder<TState, TResult> decoder)
Reads a value from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkey— Key to be looked up in the databasestate— State that will be forwarded to thedecoderdecoder— Decoder that will extract the result from the value found in the database
Returns: Task that will return the value of the key if it is found, Slice.Nil if the key does not exist, or an exception
GetBatchAsync
static Task<KeyValuePair<Slice, Slice>[]> GetBatchAsync(IFdbReadOnlyTransaction trans, IEnumerable<Slice> keys)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the database
Returns: Task that will return an array of key/value pairs, or an exception. Each pair in the array will contain the key at the same index in keys, and its corresponding value in the database or Slice.Nil if that key does not exist.
This method is equivalent to calling , except that it will return the keys in addition to the values.
static Task<KeyValuePair<Slice, Slice>[]> GetBatchAsync(IFdbReadOnlyTransaction trans, Slice[] keys)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Array of keys to be looked up in the database
Returns: Task that will return an array of key/value pairs, or an exception. Each pair in the array will contain the key at the same index in keys, and its corresponding value in the database or Slice.Nil if that key does not exist.
This method is equivalent to calling , except that it will return the keys in addition to the values.
static Task<KeyValuePair<Slice, TValue>[]> GetBatchAsync<TValue>(IFdbReadOnlyTransaction trans, IEnumerable<Slice> keys, IValueEncoder<TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Array of keys to be looked up in the databasedecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of pairs of key and decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task<KeyValuePair<Slice, TValue>[]> GetBatchAsync<TValue>(IFdbReadOnlyTransaction trans, Slice[] keys, IValueEncoder<TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databasedecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of pairs of key and decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
GetEstimatedRangeSizeBytesAsync
static Task<long> GetEstimatedRangeSizeBytesAsync(IFdbReadOnlyTransaction trans, KeyRange range)
Returns an estimated byte size of the key range.
trans— Transaction to use for the operationrange— Range of keys
Returns: Task that will return an estimated byte size of the key range, or an exception
The estimated size is calculated based on the sampling done by FDB server. The sampling algorithm works roughly in this way: the larger the key-value pair is, the more likely it would be sampled and the more accurate its sampled size would be. And due to that reason it is recommended to use this API to query against large ranges for accuracy considerations. For a rough reference, if the returned size is larger than 3MB, one can consider the size to be accurate.
static Task<long> GetEstimatedRangeSizeBytesAsync<TKeyRange>(IFdbReadOnlyTransaction trans, in TKeyRange range)
Returns an estimated byte size of the key range.
trans— Transaction to use for the operationrange— Range of keys
Returns: Task that will return an estimated byte size of the key range, or an exception
The estimated size is calculated based on the sampling done by FDB server. The sampling algorithm works roughly in this way: the larger the key-value pair is, the more likely it would be sampled and the more accurate its sampled size would be. And due to that reason it is recommended to use this API to query against large ranges for accuracy considerations. For a rough reference, if the returned size is larger than 3MB, one can consider the size to be accurate.
static Task<long> GetEstimatedRangeSizeBytesAsync(IFdbReadOnlyTransaction trans, Slice beginKey, Slice endKey)
Returns an estimated byte size of the key range.
trans— Transaction to use for the operationbeginKey— Name of the key of the start of the rangeendKey— Name of the key of the end of the range
Returns: Task that will return an estimated byte size of the key range, or an exception
The estimated size is calculated based on the sampling done by FDB server. The sampling algorithm works roughly in this way: the larger the key-value pair is, the more likely it would be sampled and the more accurate its sampled size would be. And due to that reason it is recommended to use this API to query against large ranges for accuracy considerations. For a rough reference, if the returned size is larger than 3MB, one can consider the size to be accurate.
static Task<long> GetEstimatedRangeSizeBytesAsync<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in TBeginKey beginKey, in TEndKey endKey)
Returns an estimated byte size of the key range.
trans— Transaction to use for the operationbeginKey— Name of the key of the start of the rangeendKey— Name of the key of the end of the range
Returns: Task that will return an estimated byte size of the key range, or an exception
The estimated size is calculated based on the sampling done by FDB server. The sampling algorithm works roughly in this way: the larger the key-value pair is, the more likely it would be sampled and the more accurate its sampled size would be. And due to that reason it is recommended to use this API to query against large ranges for accuracy considerations. For a rough reference, if the returned size is larger than 3MB, one can consider the size to be accurate.
static Task<long> GetEstimatedRangeSizeBytesAsync<TEndKey>(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> beginKey, in TEndKey endKey)
Returns an estimated byte size of the key range.
trans— Transaction to use for the operationbeginKey— Name of the key of the start of the rangeendKey— Name of the key of the end of the range
Returns: Task that will return an estimated byte size of the key range, or an exception
The estimated size is calculated based on the sampling done by FDB server. The sampling algorithm works roughly in this way: the larger the key-value pair is, the more likely it would be sampled and the more accurate its sampled size would be. And due to that reason it is recommended to use this API to query against large ranges for accuracy considerations. For a rough reference, if the returned size is larger than 3MB, one can consider the size to be accurate.
GetKeyAsync
static Task<Slice> GetKeyAsync<TKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TKey> selector)
Resolves a key selector against the keys in the database snapshot represented by the current transaction.
selector— Key selector to resolve
Returns: Task that will return the key matching the selector, or an exception
GetKeysAsync
static Task<Slice[]> GetKeysAsync(IFdbReadOnlyTransaction trans, KeySelector[] selectors)
Resolves several key selectors against the keys in the database snapshot represented by the current transaction.
trans— Transaction to use for the operationselectors— Key selectors to resolve
Returns: Task that will return an array of keys matching the selectors, or an exception
static Task<Slice[]> GetKeysAsync(IFdbReadOnlyTransaction trans, IEnumerable<KeySelector> selectors)
Resolves several key selectors against the keys in the database snapshot represented by the current transaction.
trans— Transaction to use for the operationselectors— Sequence of key selectors to resolve
Returns: Task that will return an array of keys matching the selectors, or an exception
static Task<Slice[]> GetKeysAsync<TKey>(IFdbReadOnlyTransaction trans, ReadOnlySpan<FdbKeySelector<TKey>> selectors)
Resolves several key selectors against the keys in the database snapshot represented by the current transaction.
trans— Transaction to use for the operationselectors— Sequence of key selectors to resolve
Returns: Task that will return an array of keys matching the selectors, or an exception
static Task<Slice[]> GetKeysAsync<TKey>(IFdbReadOnlyTransaction trans, IEnumerable<FdbKeySelector<TKey>> selectors)
Resolves several key selectors against the keys in the database snapshot represented by the current transaction.
trans— Transaction to use for the operationselectors— Sequence of key selectors to resolve
Returns: Task that will return an array of keys matching the selectors, or an exception
GetMetadataVersionKeyAsync
static Task<VersionStamp?> GetMetadataVersionKeyAsync<TKey>(IFdbReadOnlyTransaction trans, in TKey key)
Safely read a key containing a VersionStamp representing the version of some metadata or schema information stored in the database.
key— Key to read. If Nil, read the global\xff/metadataVersionkey
Either the current value of the key, or if the key has already changed in this transaction
GetRange
static IFdbKeyValueRangeQuery GetRange(IFdbReadOnlyTransaction trans, KeyRange range, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbKeyValueRangeQuery GetRange<TKeyRange>(IFdbReadOnlyTransaction trans, TKeyRange range, FdbRangeOptions options = null)
static IFdbKeyValueRangeQuery GetRange(IFdbReadOnlyTransaction trans, KeySelectorPair range, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbKeyValueRangeQuery GetRange<TBeginKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, KeySelector endKeyExclusive, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction
options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbKeyValueRangeQuery GetRange<TEndKey>(IFdbReadOnlyTransaction trans, KeySelector beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction
options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbKeyValueRangeQuery GetRange<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction
options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbKeyValueRangeQuery GetRange<TBeginKey>(IFdbReadOnlyTransaction trans, TBeginKey beginKeyInclusive, Slice endKeyExclusive, FdbRangeOptions options = null)
static IFdbKeyValueRangeQuery GetRange<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, TBeginKey beginKeyInclusive, TEndKey endKeyExclusive, FdbRangeOptions options = null)
static IFdbKeyValueRangeQuery GetRange(IFdbReadOnlyTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRange<TResult>(IFdbReadOnlyTransaction trans, KeyRange range, Func<KeyValuePair<Slice, Slice>, TResult> transform, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRange<TResult>(IFdbReadOnlyTransaction trans, KeySelectorPair range, Func<KeyValuePair<Slice, Slice>, TResult> transform, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRange<TKeyRange, TState, TResult>(IFdbReadOnlyTransaction trans, in TKeyRange range, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRange<TResult>(IFdbReadOnlyTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive, Func<KeyValuePair<Slice, Slice>, TResult> transform, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRange<TState, TResult>(IFdbReadOnlyTransaction trans, KeyRange range, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRange<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRange<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRange<TState, TResult>(IFdbReadOnlyTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read all key-value pairs in the database snapshot represented by the transaction
GetRangeAsync
static Task<FdbRangeChunk> GetRangeAsync(IFdbReadOnlyTransaction trans, KeySelectorPair range, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationrange— key selector pair defining the beginning and the end of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
static Task<FdbRangeChunk> GetRangeAsync(IFdbReadOnlyTransaction trans, KeyRange range, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationrange— Range of keys defining the beginning (inclusive) and the end (exclusive) of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
static Task<FdbRangeChunk> GetRangeAsync<TKeyRange>(IFdbReadOnlyTransaction trans, in TKeyRange range, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
static Task<FdbRangeChunk> GetRangeAsync<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginInclusive, in FdbKeySelector<TEndKey> endExclusive, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the beginning key selector and lexicographically less than the key resolved by the end key selector.
beginInclusive— key selector defining the beginning of the rangeendExclusive— key selector defining the end of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
Returns: Chunk of results
static Task<FdbRangeChunk> GetRangeAsync<TBeginKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginInclusive, KeySelector endExclusive, FdbRangeOptions options = null, int iteration = 0)
static Task<FdbRangeChunk> GetRangeAsync<TBeginKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginInclusive, KeySpanSelector endExclusive, FdbRangeOptions options = null, int iteration = 0)
static Task<FdbRangeChunk> GetRangeAsync<TEndKey>(IFdbReadOnlyTransaction trans, KeySelector beginInclusive, in FdbKeySelector<TEndKey> endExclusive, FdbRangeOptions options = null, int iteration = 0)
static Task<FdbRangeChunk> GetRangeAsync<TEndKey>(IFdbReadOnlyTransaction trans, KeySpanSelector beginInclusive, in FdbKeySelector<TEndKey> endExclusive, FdbRangeOptions options = null, int iteration = 0)
static Task<FdbRangeChunk> GetRangeAsync(IFdbReadOnlyTransaction trans, Slice beginInclusive, Slice endExclusive, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationbeginInclusive— Key defining the beginning (inclusive) of the rangeendExclusive— Key defining the end (exclusive) of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
static Task<FdbRangeChunk> GetRangeAsync<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in TBeginKey beginInclusive, in TEndKey endExclusive, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationbeginInclusive— Key defining the beginning (inclusive) of the rangeendExclusive— Key defining the end (exclusive) of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
static Task<FdbRangeChunk<TResult>> GetRangeAsync<TState, TResult>(IFdbReadOnlyTransaction trans, Slice beginInclusive, Slice endExclusive, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationbeginInclusive— Key defining the beginning (inclusive) of the rangeendExclusive— Key defining the end (exclusive) of the rangestate— State that will be forwarded to thedecoderdecoder— Decoder that will extract the result from the value found in the databaseoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
static Task<FdbRangeChunk<TResult>> GetRangeAsync<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginInclusive, in FdbKeySelector<TEndKey> endExclusive, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the beginning key selector and lexicographically less than the key resolved by the end key selector.
beginInclusive— key selector defining the beginning of the rangeendExclusive— key selector defining the end of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
Returns: Chunk of results
static Task<FdbRangeChunk<TResult>> GetRangeAsync<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in TBeginKey beginInclusive, in TEndKey endExclusive, TState state, FdbKeyValueDecoder<TState, TResult> decoder, FdbRangeOptions options = null, int iteration = 0)
Reads all key-value pairs in the database snapshot represented by transaction (potentially limited by Limit, TargetBytes, or Mode) which have a key lexicographically greater than or equal to the key resolved by the Begin key selector and lexicographically less than the key resolved by the End key selector.
trans— Transaction to use for the operationbeginInclusive— Key defining the beginning (inclusive) of the rangeendExclusive— Key defining the end (exclusive) of the rangeoptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)iteration— If streaming mode is FdbStreamingMode.Iterator, this parameter should start at 1 and be incremented by 1 for each successive call while reading this range. In all other cases it is ignored.
GetRangeKeys
static IFdbRangeQuery<Slice> GetRangeKeys(IFdbReadOnlyTransaction trans, KeyRange range, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeKeys<TKeyRange>(IFdbReadOnlyTransaction trans, TKeyRange range, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeKeys(IFdbReadOnlyTransaction trans, KeySelectorPair range, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeKeys(IFdbReadOnlyTransaction trans, KeySelector beginInclusive, KeySelector endExclusive, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeKeys<TResult>(IFdbReadOnlyTransaction trans, KeyRange range, FdbRangeDecoder<TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeKeys<TKeyRange, TResult>(IFdbReadOnlyTransaction trans, in TKeyRange range, FdbRangeDecoder<TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeKeys(IFdbReadOnlyTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeKeys<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeKeys<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeKeys<TState, TResult>(IFdbReadOnlyTransaction trans, KeyRange range, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeKeys<TKeyRange, TState, TResult>(IFdbReadOnlyTransaction trans, in TKeyRange range, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the keys of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeKeys<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRangeKeys<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRangeKeys<TState, TResult>(IFdbReadOnlyTransaction trans, KeySelector beginInclusive, KeySelector endExclusive, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
GetRangeSplitPointsAsync
static Task<Slice[]> GetRangeSplitPointsAsync(IFdbReadOnlyTransaction trans, Slice beginKey, Slice endKey, long chunkSize)
Returns a list of keys that can split the given range into (roughly) equally sized chunks based on chunkSize.
beginKey— Name of the key of the start of the rangeendKey— Name of the key of the end of the rangechunkSize— Size of chunks that will be used to split the range
Returns: Task that will return an array of keys that split the range in equally sized chunks, or an exception
The returned split points contain the start key and end key of the given range
static Task<Slice[]> GetRangeSplitPointsAsync<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in TBeginKey beginKey, in TEndKey endKey, long chunkSize)
Returns a list of keys that can split the given range into (roughly) equally sized chunks based on chunkSize.
beginKey— Name of the key of the start of the rangeendKey— Name of the key of the end of the rangechunkSize— Size of chunks that will be used to split the range
Returns: Task that will return an array of keys that split the range in equally sized chunks, or an exception
The returned split points contain the start key and end key of the given range
static Task<Slice[]> GetRangeSplitPointsAsync<TEndKey>(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> beginKey, in TEndKey endKey, long chunkSize)
Returns a list of keys that can split the given range into (roughly) equally sized chunks based on chunkSize.
beginKey— Name of the key of the start of the rangeendKey— Name of the key of the end of the rangechunkSize— Size of chunks that will be used to split the range
Returns: Task that will return an array of keys that split the range in equally sized chunks, or an exception
The returned split points contain the start key and end key of the given range
GetRangeValues
static IFdbRangeQuery<Slice> GetRangeValues(IFdbReadOnlyTransaction trans, KeyRange range, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeValues<TKeyRange>(IFdbReadOnlyTransaction trans, in TKeyRange range, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeValues(IFdbReadOnlyTransaction trans, KeySelectorPair range, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeValues(IFdbReadOnlyTransaction trans, KeySelector beginInclusive, KeySelector endExclusive, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeValues<TResult>(IFdbReadOnlyTransaction trans, KeyRange range, FdbRangeDecoder<TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeValues<TKeyRange, TResult>(IFdbReadOnlyTransaction trans, in TKeyRange range, FdbRangeDecoder<TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<Slice> GetRangeValues(IFdbReadOnlyTransaction trans, Slice beginKeyInclusive, Slice endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeValues<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in TBeginKey beginKeyInclusive, in TEndKey endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<Slice> GetRangeValues<TBeginKey, TEndKey>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeValues<TState, TResult>(IFdbReadOnlyTransaction trans, KeyRange range, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
static IFdbRangeQuery<TResult> GetRangeValues<TKeyRange, TState, TResult>(IFdbReadOnlyTransaction trans, in TKeyRange range, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRangeValues<TBeginKey, TEndKey, TState, TResult>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginKeyInclusive, in FdbKeySelector<TEndKey> endKeyExclusive, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Creates a new range query that will read all key-value pairs in the database snapshot represented by the transaction, and transform them into a result of type TResult
state— State that will be forwarded to theselectoroptions— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Range query that, once executed, will return all the key-value pairs matching the providing selector pair
static IFdbRangeQuery<TResult> GetRangeValues<TState, TResult>(IFdbReadOnlyTransaction trans, KeySelector beginInclusive, KeySelector endExclusive, TState state, FdbRangeDecoder<TState, TResult> decoder, FdbRangeOptions options = null)
Create a new range query that will read the values of all key-value pairs in the database snapshot represented by the transaction
GetValueInt32Async
static Task<int?> GetValueInt32Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<int?> GetValueInt32Async<TKey>(IFdbReadOnlyTransaction trans, in TKey key)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<int?> GetValueInt32Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<int> GetValueInt32Async(IFdbReadOnlyTransaction trans, Slice key, int missingValue)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<int> GetValueInt32Async<TKey>(IFdbReadOnlyTransaction trans, in TKey key, int missingValue)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<int> GetValueInt32Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, int missingValue)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueInt64Async
static Task<long?> GetValueInt64Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a little-endian 64-bit signed integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<long?> GetValueInt64Async<TKey>(IFdbReadOnlyTransaction trans, in TKey key)
Reads the value of a key from the database, decoded as a little-endian 64-bit signed integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<long?> GetValueInt64Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a little-endian 64-bit signed integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<long> GetValueInt64Async(IFdbReadOnlyTransaction trans, Slice key, long missingValue)
Reads the value of a key from the database, decoded as a little-endian 64-bit signed integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<long> GetValueInt64Async<TKey>(IFdbReadOnlyTransaction trans, in TKey key, long missingValue)
Reads the value of a key from the database, decoded as a little-endian 64-bit signed integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<long> GetValueInt64Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, long missingValue)
Reads the value of a key from the database, decoded as a little-endian 64-bit signed integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueStringAsync
static Task<string> GetValueStringAsync(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, into a UTF-8 encoded String
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<string> GetValueStringAsync(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, into a UTF-8 encoded String
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<string> GetValueStringAsync(IFdbReadOnlyTransaction trans, Slice key, string missingValue)
Reads the value of a key from the database, into a UTF-8 encoded String
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<string> GetValueStringAsync(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, string missingValue)
Reads the value of a key from the database, into a UTF-8 encoded String
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUInt32Async
static Task<uint?> GetValueUInt32Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<uint?> GetValueUInt32Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<uint> GetValueUInt32Async(IFdbReadOnlyTransaction trans, Slice key, uint missingValue)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<uint> GetValueUInt32Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, uint missingValue)
Reads the value of a key from the database, decoded as a little-endian 32-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUInt64Async
static Task<ulong?> GetValueUInt64Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a little-endian 64-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<ulong?> GetValueUInt64Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a little-endian 64-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<ulong> GetValueUInt64Async(IFdbReadOnlyTransaction trans, Slice key, ulong missingValue)
Reads the value of a key from the database, decoded as a little-endian 64-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<ulong> GetValueUInt64Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, ulong missingValue)
Reads the value of a key from the database, decoded as a little-endian 64-bit unsigned integer
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUuid128Async
static Task<Uuid128?> GetValueUuid128Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a 128-bit Uuid128
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid128?> GetValueUuid128Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a 128-bit Uuid128
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid128> GetValueUuid128Async(IFdbReadOnlyTransaction trans, Slice key, Uuid128 missingValue)
Reads the value of a key from the database, decoded as a 128-bit Uuid128
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<Uuid128> GetValueUuid128Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, Uuid128 missingValue)
Reads the value of a key from the database, decoded as a 128-bit Uuid128
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUuid48Async
static Task<Uuid48?> GetValueUuid48Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a 48-bit Uuid48
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid48?> GetValueUuid48Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a 48-bit Uuid48
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid48> GetValueUuid48Async(IFdbReadOnlyTransaction trans, Slice key, Uuid48 missingValue)
Reads the value of a key from the database, decoded as a 48-bit Uuid48
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<Uuid48> GetValueUuid48Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, Uuid48 missingValue)
Reads the value of a key from the database, decoded as a 48-bit Uuid48
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUuid64Async
static Task<Uuid64?> GetValueUuid64Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a 64-bit Uuid64
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid64?> GetValueUuid64Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a 64-bit Uuid64
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid64> GetValueUuid64Async(IFdbReadOnlyTransaction trans, Slice key, Uuid64 missingValue)
Reads the value of a key from the database, decoded as a 64-bit Uuid64
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<Uuid64> GetValueUuid64Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, Uuid64 missingValue)
Reads the value of a key from the database, decoded as a 64-bit Uuid64
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUuid80Async
static Task<Uuid80?> GetValueUuid80Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as an 80-bit Uuid80
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid80?> GetValueUuid80Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as an 80-bit Uuid80
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid80> GetValueUuid80Async(IFdbReadOnlyTransaction trans, Slice key, Uuid80 missingValue)
Reads the value of a key from the database, decoded as an 80-bit Uuid80
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<Uuid80> GetValueUuid80Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, Uuid80 missingValue)
Reads the value of a key from the database, decoded as an 80-bit Uuid80
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueUuid96Async
static Task<Uuid96?> GetValueUuid96Async(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a 96-bit Uuid96
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid96?> GetValueUuid96Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a 96-bit Uuid96
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<Uuid96> GetValueUuid96Async(IFdbReadOnlyTransaction trans, Slice key, Uuid96 missingValue)
Reads the value of a key from the database, decoded as a 96-bit Uuid96
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<Uuid96> GetValueUuid96Async(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, Uuid96 missingValue)
Reads the value of a key from the database, decoded as a 96-bit Uuid96
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValueVersionStampAsync
static Task<VersionStamp?> GetValueVersionStampAsync(IFdbReadOnlyTransaction trans, Slice key)
Reads the value of a key from the database, decoded as a VersionStamp
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<VersionStamp?> GetValueVersionStampAsync(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key)
Reads the value of a key from the database, decoded as a VersionStamp
trans— Transaction to use for the operationkey— Key to be looked up in the database
Returns: The decoded value of the key, if it exists in the database; otherwise, null.
static Task<VersionStamp> GetValueVersionStampAsync(IFdbReadOnlyTransaction trans, Slice key, VersionStamp missingValue)
Reads the value of a key from the database, decoded as a VersionStamp
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
static Task<VersionStamp> GetValueVersionStampAsync(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, VersionStamp missingValue)
Reads the value of a key from the database, decoded as a VersionStamp
trans— Transaction to use for the operationkey— Key to be looked up in the databasemissingValue— Value returned if the key is missing
Returns: The decoded value of the key, if it exists in the database; otherwise, missingValue.
GetValuesAsync
static Task<Slice[]> GetValuesAsync(IFdbReadOnlyTransaction trans, Slice[] keys)
Reads several values from the database snapshot represented by the current transaction
trans— Transaction to use for the operationkeys— Keys to be looked up in the database
Returns: Task that will return an array of values, or an exception. Each item in the array will contain the value of the key at the same index in keys, or Slice.Nil if that key does not exist.
static Task<Slice[]> GetValuesAsync(IFdbReadOnlyTransaction trans, IEnumerable<Slice> keys)
Reads several values from the database snapshot represented by the current transaction
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the database
Returns: Task that will return an array of values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value will be Slice.Nil.
static Task<Slice[]> GetValuesAsync<TKey>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TKey> keys)
static Task<Slice[]> GetValuesAsync<TKey>(IFdbReadOnlyTransaction trans, IEnumerable<TKey> keys)
static Task<Slice[]> GetValuesAsync<TElement, TKey>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, TKey> keySelector)
static Task<Slice[]> GetValuesAsync<TElement, TKey>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, Func<TElement, TKey> keySelector)
static Task<TValue[]> GetValuesAsync<TValue>(IFdbReadOnlyTransaction trans, IEnumerable<Slice> keys, IValueEncoder<TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databasedecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task<Slice[]> GetValuesAsync<TElement, TKeyState, TKey>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, TKeyState state, Func<TKeyState, TElement, TKey> keySelector)
static Task<Slice[]> GetValuesAsync<TElement, TKeyState, TKey>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, TKeyState state, Func<TKeyState, TElement, TKey> keySelector)
static Task<TResult[]> GetValuesAsync<TElement, TKey, TResult>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, TKey> keySelector, FdbValueDecoder<TResult> valueDecoder)
static Task<TResult[]> GetValuesAsync<TElement, TKey, TResult>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, Func<TElement, TKey> keySelector, FdbValueDecoder<TResult> valueDecoder)
static Task GetValuesAsync<TValue>(IFdbReadOnlyTransaction trans, IEnumerable<Slice> keys, Memory<TValue> results, FdbValueDecoder<TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databaseresults— Buffer where the results will be written to (must be at least as large askeys). Each entry will contain the decoded value of the key at the same index inkeys.decoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task GetValuesAsync<TKey, TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TKey> keys, Memory<TValue> results, FdbValueDecoder<TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databaseresults— Buffer where the results will be written to (must be at least as large askeys). Each entry will contain the decoded value of the key at the same index inkeys.decoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task GetValuesAsync<TKey, TValue>(IFdbReadOnlyTransaction trans, IEnumerable<TKey> keys, Memory<TValue> results, FdbValueDecoder<TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databaseresults— Buffer where the results will be written to (must be at least as large askeys). Each entry will contain the decoded value of the key at the same index inkeys.decoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task<TResult[]> GetValuesAsync<TElement, TKeyState, TKey, TResult>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, TKeyState state, Func<TKeyState, TElement, TKey> keySelector, FdbValueDecoder<TResult> valueDecoder)
static Task<TResult[]> GetValuesAsync<TElement, TKeyState, TKey, TResult>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, TKeyState state, Func<TKeyState, TElement, TKey> keySelector, FdbValueDecoder<TResult> valueDecoder)
static Task GetValuesAsync<TKey, TValueState, TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TKey> keys, Memory<TValue> results, TValueState state, FdbValueDecoder<TValueState, TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databaseresults— Buffer where the results will be written to (must be at least as large askeys). Each entry will contain the decoded value of the key at the same index inkeys.state— State forwarded to the decoderdecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task GetValuesAsync<TKey, TValueState, TValue>(IFdbReadOnlyTransaction trans, IEnumerable<TKey> keys, Memory<TValue> results, TValueState state, FdbValueDecoder<TValueState, TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationkeys— Sequence of keys to be looked up in the databaseresults— Buffer where the results will be written to (must be at least as large askeys). Each entry will contain the decoded value of the key at the same index inkeys.state— State forwarded to the decodervalueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in keys. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKey, TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, TKey> keySelector, Memory<TValue> results, FdbValueDecoder<TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of elements to be looked up in the databasekeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKey, TValue>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, Func<TElement, TKey> keySelector, Memory<TValue> results, FdbValueDecoder<TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of keys to be looked up in the databasekeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKeyState, TKey, TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, TKeyState keyState, Func<TKeyState, TElement, TKey> keySelector, Memory<TValue> results, FdbValueDecoder<TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of elements to be looked up in the databasekeyState— Opaque state forwarded tokeySelectorkeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKeyState, TKey, TValue>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, TKeyState keyState, Func<TKeyState, TElement, TKey> keySelector, Memory<TValue> results, FdbValueDecoder<TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of keys to be looked up in the databasekeyState— Opaque state forwarded tokeySelectorkeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKey, TValueState, TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, TKey> keySelector, Memory<TValue> results, TValueState valueState, FdbValueDecoder<TValueState, TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of elements to be looked up in the databasekeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueState— State forwarded to the decodervalueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKey, TValueState, TValue>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, Func<TElement, TKey> keySelector, Memory<TValue> results, TValueState valueState, FdbValueDecoder<TValueState, TValue> valueDecoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of keys to be looked up in the databasekeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueState— State forwarded to the decodervalueDecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of valueDecoder.
static Task GetValuesAsync<TElement, TKeyState, TKey, TValueState, TValue>(IFdbReadOnlyTransaction trans, ReadOnlySpan<TElement> items, TKeyState keyState, Func<TKeyState, TElement, TKey> keySelector, Memory<TValue> results, TValueState valueState, FdbValueDecoder<TValueState, TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of elements to be looked up in the databasekeyState— Opaque state forwarded tokeySelectorkeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueState— Opaque state forwarded todecoderdecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of decoder.
static Task GetValuesAsync<TElement, TKeyState, TKey, TValueState, TValue>(IFdbReadOnlyTransaction trans, IEnumerable<TElement> items, TKeyState keyState, Func<TKeyState, TElement, TKey> keySelector, Memory<TValue> results, TValueState valueState, FdbValueDecoder<TValueState, TValue> decoder)
Reads several values from the database snapshot represented by the current transaction.
trans— Transaction to use for the operationitems— Sequence of keys to be looked up in the databasekeyState— Opaque state forwarded tokeySelectorkeySelector— Function that generate the key for each elementresults— Buffer where the results will be written to (must be at least as large asitems). Each entry will contain the decoded value of the key at the same index initems.valueState— State forwarded todecoderdecoder— Decoder used to decode the results into values of typeTValue
Returns: Task that will return an array of decoded values, or an exception. The position of each item in the array is the same as its corresponding key in items. If a key does not exist in the database, its value depends on the behavior of decoder.
ProtectAgainstMetadataVersionChange
static void ProtectAgainstMetadataVersionChange(IFdbTransaction trans)
Add a read conflict range on the \xff/metadataVersion key
This is only required if a previous read to that key was done with snapshot isolation, to guarantee that the transaction will conflict! Please note that any external change to the key, unrelated to the current application code, could also trigger a conflict!
QueryAsync
static Task<List<T>> QueryAsync<T>(IFdbReadOnlyRetryable db, Func<IFdbReadOnlyTransaction, IAsyncQuery<T>> handler, CancellationToken ct)
Runs a query inside a read-only transaction context, with retry-logic.
db— Database used for the operationhandler— Lambda function that returns an async enumerable. The function may be called multiple times if the transaction conflicts.ct— Token used to cancel the operation
Returns: Task returning the list of all the elements of the async enumerable returned by the last successful call to handler.
static Task<List<T>> QueryAsync<T>(IFdbReadOnlyRetryable db, Func<IFdbReadOnlyTransaction, Task<IAsyncQuery<T>>> handler, CancellationToken ct)
Runs a query inside a read-only transaction context, with retry-logic.
db— Database used for the operationhandler— Lambda function that returns an async enumerable. The function may be called multiple times if the transaction conflicts.ct— Token used to cancel the operation
Returns: Task returning the list of all the elements of the async enumerable returned by the last successful call to handler.
static Task<List<T>> QueryAsync<T>(IFdbReadOnlyRetryable db, Func<IFdbReadOnlyTransaction, Task<IAsyncLinqQuery<T>>> handler, CancellationToken ct)
Runs a query inside a read-only transaction context, with retry-logic.
db— Database used for the operationhandler— Lambda function that returns an async enumerable. The function may be called multiple times if the transaction conflicts.ct— Token used to cancel the operation
Returns: Task returning the list of all the elements of the async enumerable returned by the last successful call to handler.
static Task<List<T>> QueryAsync<T>(IFdbReadOnlyRetryable db, Func<IFdbReadOnlyTransaction, IAsyncEnumerable<T>> handler, CancellationToken ct)
Runs a query inside a read-only transaction context, with retry-logic.
db— Database used for the operationhandler— Lambda function that returns an async enumerable. The function may be called multiple times if the transaction conflicts.ct— Token used to cancel the operation
Returns: Task returning the list of all the elements of the async enumerable returned by the last successful call to handler.
static Task<List<T>> QueryAsync<T>(IFdbReadOnlyRetryable db, Func<IFdbReadOnlyTransaction, Task<IAsyncEnumerable<T>>> handler, CancellationToken ct)
Runs a query inside a read-only transaction context, with retry-logic.
db— Database used for the operationhandler— Lambda function that returns an async enumerable. The function may be called multiple times if the transaction conflicts.ct— Token used to cancel the operation
Returns: Task returning the list of all the elements of the async enumerable returned by the last successful call to handler.
Set
static void Set(IFdbTransaction trans, Slice key, ReadOnlySpan<byte> value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set(IFdbTransaction trans, ReadOnlySpan<byte> key, Slice value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set(IFdbTransaction trans, Slice key, Slice value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set<TKey>(IFdbTransaction trans, in TKey key, Slice value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set<TKey>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set<TValue>(IFdbTransaction trans, ReadOnlySpan<byte> key, in TValue value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Sets the value of a key in the database.
key— Name of the key to be inserted into the database.value— Value to be inserted into the database.
Modifies the database snapshot represented by transaction to change the given key to have the given value.
If the given key was not previously present in the database it is inserted.
The modification affects the actual database only if transaction is later committed with CommitAsync().
static void Set<TValue>(IFdbTransaction trans, Slice key, IValueEncoder<TValue> encoder, TValue value)
Set the value of a key in the database, using a custom value encoder.
trans— Transaction to use for the operationkey— Key to setencoder— Encoder used to convertvalueinto a binary literal.value— Value of the key
static void Set<TValue>(IFdbTransaction trans, ReadOnlySpan<byte> key, IValueEncoder<TValue> encoder, TValue value)
Set the value of a key in the database, using a custom value encoder.
trans— Transaction to use for the operationkey— Key to setencoder— Encoder used to convertvalueinto a binary literal.value— Value of the key
SetValueGuid
static void SetValueGuid(IFdbTransaction trans, Slice key, Guid value)
Sets the value of a key in the database as a 128-bits UUID
static void SetValueGuid<TKey>(IFdbTransaction trans, in TKey key, Guid value)
Sets the value of a key in the database as a 128-bits UUID
static void SetValueGuid(IFdbTransaction trans, ReadOnlySpan<byte> key, Guid value)
Sets the value of a key in the database as a 128-bits UUID
SetValueInt32
static void SetValueInt32(IFdbTransaction trans, Slice key, int value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
static void SetValueInt32<TKey>(IFdbTransaction trans, in TKey key, int value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
static void SetValueInt32(IFdbTransaction trans, ReadOnlySpan<byte> key, int value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
SetValueInt32Compact
static void SetValueInt32Compact(IFdbTransaction trans, Slice key, int value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
static void SetValueInt32Compact(IFdbTransaction trans, ReadOnlySpan<byte> key, int value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
SetValueInt64
static void SetValueInt64(IFdbTransaction trans, Slice key, long value)
Sets the value of a key in the database as a 64-bits little-endian signed integer
static void SetValueInt64<TKey>(IFdbTransaction trans, in TKey key, long value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
static void SetValueInt64(IFdbTransaction trans, ReadOnlySpan<byte> key, long value)
Sets the value of a key in the database as a 64-bits little-endian signed integer
SetValueInt64Compact
static void SetValueInt64Compact(IFdbTransaction trans, Slice key, long value)
Sets the value of a key in the database as a 64-bits little-endian signed integer
static void SetValueInt64Compact(IFdbTransaction trans, ReadOnlySpan<byte> key, long value)
Sets the value of a key in the database as a 64-bits little-endian signed integer
SetValueString
static void SetValueString(IFdbTransaction trans, Slice key, string value)
Sets the value of a key in the database as a UTF-8 encoded string
static void SetValueString(IFdbTransaction trans, ReadOnlySpan<byte> key, string value)
Sets the value of a key in the database as a UTF-8 encoded string
static void SetValueString(IFdbTransaction trans, Slice key, ReadOnlySpan<char> value)
Sets the value of a key in the database as a UTF-8 encoded string
static void SetValueString(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<char> value)
Sets the value of a key in the database as a UTF-8 encoded string
SetValueUInt32
static void SetValueUInt32(IFdbTransaction trans, Slice key, uint value)
Sets the value of a key in the database as a 32-bits little-endian unsigned integer
static void SetValueUInt32<TKey>(IFdbTransaction trans, in TKey key, uint value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
static void SetValueUInt32(IFdbTransaction trans, ReadOnlySpan<byte> key, uint value)
Sets the value of a key in the database as a 32-bits little-endian unsigned integer
SetValueUInt32Compact
static void SetValueUInt32Compact(IFdbTransaction trans, Slice key, uint value)
Sets the value of a key in the database as a 32-bits little-endian unsigned integer
static void SetValueUInt32Compact(IFdbTransaction trans, ReadOnlySpan<byte> key, uint value)
Sets the value of a key in the database as a 32-bits little-endian unsigned integer
SetValueUInt64
static void SetValueUInt64(IFdbTransaction trans, Slice key, ulong value)
Sets the value of a key in the database as a 64-bits little-endian unsigned integer
static void SetValueUInt64<TKey>(IFdbTransaction trans, in TKey key, ulong value)
Sets the value of a key in the database as a 32-bits little-endian signed integer
static void SetValueUInt64(IFdbTransaction trans, ReadOnlySpan<byte> key, ulong value)
Sets the value of a key in the database as a 64-bits little-endian unsigned integer
SetValueUInt64Compact
static void SetValueUInt64Compact(IFdbTransaction trans, Slice key, ulong value)
Sets the value of a key in the database as a 64-bits little-endian unsigned integer
static void SetValueUInt64Compact(IFdbTransaction trans, ReadOnlySpan<byte> key, ulong value)
Sets the value of a key in the database as a 64-bits little-endian unsigned integer
SetValueUuid128
static void SetValueUuid128(IFdbTransaction trans, Slice key, Uuid128 value)
Sets the value of a key in the database as a 128-bits UUID
static void SetValueUuid128<TKey>(IFdbTransaction trans, in TKey key, Uuid128 value)
Sets the value of a key in the database as a 128-bits UUID
static void SetValueUuid128(IFdbTransaction trans, ReadOnlySpan<byte> key, Uuid128 value)
Sets the value of a key in the database as a 128-bits UUID
SetValueUuid48
static void SetValueUuid48(IFdbTransaction trans, Slice key, Uuid48 value)
Sets the value of a key in the database as a 48-bits UUID
static void SetValueUuid48<TKey>(IFdbTransaction trans, in TKey key, Uuid48 value)
Sets the value of a key in the database as a 48-bits UUID
static void SetValueUuid48(IFdbTransaction trans, ReadOnlySpan<byte> key, Uuid48 value)
Sets the value of a key in the database as a 48-bits UUID
SetValueUuid64
static void SetValueUuid64(IFdbTransaction trans, Slice key, Uuid64 value)
Sets the value of a key in the database as a 64-bits UUID
static void SetValueUuid64<TKey>(IFdbTransaction trans, in TKey key, Uuid64 value)
Sets the value of a key in the database as a 64-bits UUID
static void SetValueUuid64(IFdbTransaction trans, ReadOnlySpan<byte> key, Uuid64 value)
Sets the value of a key in the database as a 64-bits UUID
SetValueUuid80
static void SetValueUuid80(IFdbTransaction trans, Slice key, Uuid80 value)
Sets the value of a key in the database as a 96-bits UUID
static void SetValueUuid80<TKey>(IFdbTransaction trans, in TKey key, Uuid80 value)
Sets the value of a key in the database as an 80-bits UUID
static void SetValueUuid80(IFdbTransaction trans, ReadOnlySpan<byte> key, Uuid80 value)
Sets the value of a key in the database as a 96-bits UUID
SetValueUuid96
static void SetValueUuid96(IFdbTransaction trans, Slice key, Uuid96 value)
Sets the value of a key in the database as a 96-bits UUID
static void SetValueUuid96<TKey>(IFdbTransaction trans, in TKey key, Uuid96 value)
Sets the value of a key in the database as a 96-bits UUID
static void SetValueUuid96(IFdbTransaction trans, ReadOnlySpan<byte> key, Uuid96 value)
Sets the value of a key in the database as a 96-bits UUID
SetValues
static void SetValues(IFdbTransaction trans, KeyValuePair<Slice, Slice>[] keyValuePairs)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationkeyValuePairs— Array of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, (Slice, Slice)[] keyValuePairs)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationkeyValuePairs— Array of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, ReadOnlySpan<KeyValuePair<Slice, Slice>> keyValuePairs)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationkeyValuePairs— Array of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, ReadOnlySpan<(Slice, Slice)> keyValuePairs)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationkeyValuePairs— Array of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, IEnumerable<KeyValuePair<Slice, Slice>> keyValuePairs)
Set the values of a sequence of keys in the database.
trans— Transaction to use for the operationkeyValuePairs— Sequence of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, IEnumerable<(Slice, Slice)> keyValuePairs)
Set the values of a sequence of keys in the database.
trans— Transaction to use for the operationkeyValuePairs— Sequence of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues<TKey, TValue>(IFdbTransaction trans, ReadOnlySpan<(TKey, TValue)> items)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationitems— Span of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues<TKey, TValue>(IFdbTransaction trans, IEnumerable<(TKey, TValue)> items)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationitems— Sequence of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues<TKey, TValue>(IFdbTransaction trans, ReadOnlySpan<KeyValuePair<TKey, TValue>> items)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationitems— Span of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues<TKey, TValue>(IFdbTransaction trans, IEnumerable<KeyValuePair<TKey, TValue>> items)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationitems— Sequence of key and value pairs
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, Slice[] keys, Slice[] values)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationkeys— Array of keys to setvalues— Array of values for each key. Must be in the same order askeysand have the same length.
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, ReadOnlySpan<Slice> keys, ReadOnlySpan<Slice> values)
Set the values of a list of keys in the database.
trans— Transaction to use for the operationkeys— Array of keys to setvalues— Array of values for each key. Must be in the same order askeysand have the same length.
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues(IFdbTransaction trans, IEnumerable<Slice> keys, IEnumerable<Slice> values)
Set the values of a sequence of keys in the database.
trans— Transaction to use for the operationkeys— Sequence of keys to setvalues— Sequence of values for each key. Must be in the same order askeysand have the same number of elements.
Only use this method if you know that the approximate size of count of keys and values will not exceed the maximum size allowed per transaction. If the list and size of the keys and values is not known in advance, consider using a bulk operation provided by the helper class.
static void SetValues<TElement>(IFdbTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, ReadOnlySpan<byte>> keySelector, Func<TElement, ReadOnlySpan<byte>> valueSelector)
static void SetValues<TElement>(IFdbTransaction trans, IEnumerable<TElement> items, Func<TElement, ReadOnlySpan<byte>> keySelector, Func<TElement, ReadOnlySpan<byte>> valueSelector)
static void SetValues<TElement>(IFdbTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, Slice> keySelector, Func<TElement, Slice> valueSelector)
static void SetValues<TElement>(IFdbTransaction trans, IEnumerable<TElement> items, Func<TElement, Slice> keySelector, Func<TElement, Slice> valueSelector)
static void SetValues<TElement, TKey, TValue>(IFdbTransaction trans, ReadOnlySpan<TElement> items, Func<TElement, TKey> keySelector, Func<TElement, TValue> valueSelector)
static void SetValues<TElement, TKey, TValue>(IFdbTransaction trans, IEnumerable<TElement> items, Func<TElement, TKey> keySelector, Func<TElement, TValue> valueSelector)
SetVersionStampedKey
static void SetVersionStampedKey(IFdbTransaction trans, Slice key, Slice value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose position will be automatically detected.value— New value for this key.
static void SetVersionStampedKey(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose position will be automatically detected.value— New value for this key.
static void SetVersionStampedKey<TKey>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose position will be automatically detected.value— New value for this key.
static void SetVersionStampedKey<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose position will be automatically detected.value— New value for this key.
static void SetVersionStampedKey<TValue>(IFdbTransaction trans, ReadOnlySpan<byte> key, in TValue value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose position will be automatically detected.value— New value for this key.
static void SetVersionStampedKey<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose position will be automatically detected.value— New value for this key.
static void SetVersionStampedKey(IFdbTransaction trans, Slice key, int stampOffset, Slice value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose start is defined bystampOffset.stampOffset— Offset inkeywhere the 80-bit VersionStamp is located.value— New value for this key.
static void SetVersionStampedKey(IFdbTransaction trans, ReadOnlySpan<byte> key, int stampOffset, ReadOnlySpan<byte> value)
Set the value of the key in the database, with the VersionStamp replaced by the resolved version at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated. This key must contain a single VersionStamp, whose start is defined bystampOffset.stampOffset— Offset inkeywhere the 80-bit VersionStamp is located.value— New value for this key.
SetVersionStampedValue
static void SetVersionStampedValue(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value)
Sets the value of the key in the database, filling the incomplete VersionStamp in the value with the resolved value at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value that contains an Incomplete stamp. This part of the value will be overwritten, by the database, with the resolved VersionStamp at commit time.
Prior to API level 520, the version stamp can only be in the first 10 bytes of the value. From 520 and greater, the version stamp can be anywhere inside the value.
There must be only one incomplete version stamp per value, which must be equal to the value returned by CreateVersionStamp (or similar methods).
static void SetVersionStampedValue<TKey>(IFdbTransaction trans, in TKey key, ReadOnlySpan<byte> value)
Sets the value of the key in the database, filling the incomplete VersionStamp in the value with the resolved value at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value that contains an Incomplete stamp. This part of the value will be overwritten, by the database, with the resolved VersionStamp at commit time.
Prior to API level 520, the version stamp can only be in the first 10 bytes of the value. From 520 and greater, the version stamp can be anywhere inside the value.
There must be only one incomplete version stamp per value, which must be equal to the value returned by CreateVersionStamp (or similar methods).
static void SetVersionStampedValue<TValue>(IFdbTransaction trans, Slice key, in TValue value)
Sets the value of the key in the database, filling the incomplete VersionStamp in the value with the resolved value at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value that contains an Incomplete stamp. This part of the value will be overwritten, by the database, with the resolved VersionStamp at commit time.
Prior to API level 520, the version stamp can only be in the first 10 bytes of the value. From 520 and greater, the version stamp can be anywhere inside the value.
There must be only one incomplete version stamp per value, which must be equal to the value returned by CreateVersionStamp (or similar methods).
static void SetVersionStampedValue<TValue>(IFdbTransaction trans, ReadOnlySpan<byte> key, in TValue value)
Sets the value of the key in the database, filling the incomplete VersionStamp in the value with the resolved value at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value that contains an Incomplete stamp. This part of the value will be overwritten, by the database, with the resolved VersionStamp at commit time.
Prior to API level 520, the version stamp can only be in the first 10 bytes of the value. From 520 and greater, the version stamp can be anywhere inside the value.
There must be only one incomplete version stamp per value, which must be equal to the value returned by CreateVersionStamp (or similar methods).
static void SetVersionStampedValue<TKey, TValue>(IFdbTransaction trans, in TKey key, in TValue value)
Sets the value of the key in the database, filling the incomplete VersionStamp in the value with the resolved value at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value that contains an Incomplete stamp. This part of the value will be overwritten, by the database, with the resolved VersionStamp at commit time.
Prior to API level 520, the version stamp can only be in the first 10 bytes of the value. From 520 and greater, the version stamp can be anywhere inside the value.
There must be only one incomplete version stamp per value, which must be equal to the value returned by CreateVersionStamp (or similar methods).
static void SetVersionStampedValue(IFdbTransaction trans, Slice key, Slice value, int stampOffset)
Sets the value of the key in the database, filling the incomplete VersionStamp at the given offset in the value with the resolved VersionStamp at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value of the key. The 10 bytes starting atstampOffsetwill be overwritten by the database with the resolved VersionStamp at commit time. The rest of the value will be untouched.stampOffset— Offset invaluewhere the 80-bit VersionStamp is located. Prior to API version 520, it can only be located at offset 0.
static void SetVersionStampedValue<TKey>(IFdbTransaction trans, in TKey key, Slice value, int stampOffset)
Sets the value of the key in the database, filling the incomplete VersionStamp at the given offset in the value with the resolved VersionStamp at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value of the key. The 10 bytes starting atstampOffsetwill be overwritten by the database with the resolved VersionStamp at commit time. The rest of the value will be untouched.stampOffset— Offset invaluewhere the 80-bit VersionStamp is located. Prior to API version 520, it can only be located at offset 0.
static void SetVersionStampedValue(IFdbTransaction trans, ReadOnlySpan<byte> key, ReadOnlySpan<byte> value, int stampOffset)
Sets the value of the key in the database, filling the incomplete VersionStamp at the given offset in the value with the resolved VersionStamp at commit time.
trans— Transaction to use for the operationkey— Name of the key whose value is to be mutated.value— Value of the key. The 10 bytes starting atstampOffsetwill be overwritten by the database with the resolved VersionStamp at commit time. The rest of the value will be untouched.stampOffset— Offset invaluewhere the 80-bit VersionStamp is located. Prior to API version 520, it can only be located at offset 0.
TouchMetadataVersionKey
static void TouchMetadataVersionKey<TKey>(IFdbTransaction trans, in TKey key)
Bumps the value of a metadata key of the database snapshot represented by the current transaction.
key— Key to mutate. If Nil, mutate the global\xff/metadataVersionkey
The value of the key will be updated to a value higher than any previous value, once the transaction commits.
Until this happens, any additional call to GetMetadataVersionKeyAsync will return null.
If the value of the key is read via a regular GetAsync or GetRange call, the transaction will fail to commit!
This method requires API version 610 or greater.
TryGetAsync
static Task<bool> TryGetAsync(IFdbReadOnlyTransaction trans, Slice key, IBufferWriter<byte> valueWriter)
Tries to read a value from database snapshot represented by the current transaction, and writes it to valueWriter if found.
trans— Transaction to use for the operationkey— Key to be looked up in the databasevalueWriter— Buffer writer where the value will be written, if it is found
Returns: Task with true if the key was found; otherwise, false
static Task<bool> TryGetAsync(IFdbReadOnlyTransaction trans, ReadOnlySpan<byte> key, IBufferWriter<byte> valueWriter)
Tries to read a value from database snapshot represented by the current transaction, and writes it to valueWriter if found.
trans— Transaction to use for the operationkey— Key to be looked up in the databasevalueWriter— Buffer writer where the value will be written, if it is found
Returns: Task with true if the key was found; otherwise, false
VisitRangeAsync
static Task<long> VisitRangeAsync<TState>(IFdbReadOnlyTransaction trans, KeyRange range, TState state, FdbKeyValueAction<TState> visitor, FdbRangeOptions options = null)
Visits all key-value pairs in the database snapshot represent by the transaction
trans— Transaction to use for the operationrange— Range of keys defining the beginning (inclusive) and the end (exclusive) of the rangestate— State that will be forwarded to thevisitorvisitor— Lambda called for each key-value pair, in order.options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
static Task<long> VisitRangeAsync<TKeyRange, TState>(IFdbReadOnlyTransaction trans, in TKeyRange range, TState state, FdbKeyValueAction<TState> visitor, FdbRangeOptions options = null)
Visits all key-value pairs in the database snapshot represent by the transaction
trans— Transaction to use for the operationstate— State that will be forwarded to thevisitorvisitor— Lambda called for each key-value pair, in order.options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
static Task<long> VisitRangeAsync<TState>(IFdbReadOnlyTransaction trans, Slice beginInclusive, Slice endExclusive, TState state, FdbKeyValueAction<TState> visitor, FdbRangeOptions options = null)
Visits all key-value pairs in the database snapshot represent by the transaction
trans— Transaction to use for the operationbeginInclusive— Key defining the beginning (inclusive) of the rangeendExclusive— Key defining the end (exclusive) of the rangestate— State that will be forwarded to thevisitorvisitor— Lambda called for each key-value pair, in order.options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
static Task<long> VisitRangeAsync<TBeginKey, TEndKey, TState>(IFdbReadOnlyTransaction trans, in TBeginKey beginInclusive, in TEndKey endExclusive, TState state, FdbKeyValueAction<TState> visitor, FdbRangeOptions options = null)
Visits all key-value pairs in the database snapshot represent by the transaction
trans— Transaction to use for the operationbeginInclusive— Key defining the beginning (inclusive) of the rangeendExclusive— Key defining the end (exclusive) of the rangestate— State that will be forwarded to thevisitorvisitor— Lambda called for each key-value pair, in order.options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
static Task<long> VisitRangeAsync<TBeginKey, TEndKey, TState>(IFdbReadOnlyTransaction trans, in FdbKeySelector<TBeginKey> beginInclusive, in FdbKeySelector<TEndKey> endExclusive, TState state, FdbKeyValueAction<TState> visitor, FdbRangeOptions options = null)
Visits all key-value pairs in the database snapshot represent by the transaction
beginInclusive— key selector defining the beginning of the rangeendExclusive— key selector defining the end of the rangestate— State that will be forwarded to thevisitorvisitor— Lambda called for each key-value pair, in order.options— Optional query options (Limit, TargetBytes, Mode, Reverse, ...)
Returns: Number of key/value pairs visited
Watch
static FdbWatch Watch(IFdbTransaction trans, Slice key, CancellationToken ct)
Watches a key for any future change in the database.
key— Name of the key that will be watchedct— Token used to abort the watch if the caller doesn't want to wait anymore.
Returns: FdbWatch instance that can be awaited and will complete when the key has changed in the database, or cancellation occurs.
The watch will only become active if the transaction successfully commits, and should NOT be awaited from within the same or another transaction.
You can directly await an FdbWatch, or use the Task property.
You can call Cancel> at any time if you are not interested in watching the key anymore.
You MUST always call Dispose if the watch completes or is cancelled, to ensure that resources are released properly.
It is possible (though rare) that a Watch fires even if the key did not change.
static FdbWatch Watch<TKey>(IFdbTransaction trans, in TKey key, CancellationToken ct)
Watches a key for any future change in the database.
key— Name of the key that will be watchedct— Token used to abort the watch if the caller doesn't want to wait anymore.
Returns: FdbWatch instance that can be awaited and will complete when the key has changed in the database, or cancellation occurs.
The watch will only become active if the transaction successfully commits, and should NOT be awaited from within the same or another transaction.
You can directly await an FdbWatch, or use the Task property.
You can call Cancel> at any time if you are not interested in watching the key anymore.
You MUST always call Dispose if the watch completes or is cancelled, to ensure that resources are released properly.
It is possible (though rare) that a Watch fires even if the key did not change.
WithOptions
static TTransaction WithOptions<TTransaction>(TTransaction trans, Action<IFdbTransactionOptions> configure)
Configure the options of this transaction.