me.vedang.clj-fdb.transaction

clear-key

(clear-key tr k)

When given a Transaction and a key, clears a given key from the database. This will not affect the database until commit() is called.

clear-range

(clear-range tr rg)

When given a Range, clears a range of keys in the database. The upper bound of the range is exclusive; that is, the key (if one exists) that is specified as the end of the range will NOT be cleared as part of this operation. Range clears are efficient with FoundationDB – clearing large amounts of data will be fast. This will not affect the database until commit() is called.

get

(get tr k)

Gets a value from the database. The call will return null if the key is not present in the database.

get-range

(get-range tr rg)

Gets an ordered range of keys and values from the database. The begin and end keys are specified by byte[] arrays, with the begin key inclusive and the end key exclusive. Ranges are returned from calls to Tuple.range() and Range.startsWith(byte[]).

read

(read tc tr-fn)

Takes a TransactionContext and runs a function fn in this context that takes a read-only transaction. Depending on the type of context, this may execute the supplied function multiple times if an error is encountered. This method is blocking – control will not return from this call until work is complete.

read-async!

(read-async! tc tr-fn)

Takes a TransactionContext and runs a function fn in this context that takes a read-only transaction. Depending on the type of context, this may execute the supplied function multiple times if an error is encountered. This method is non-blocking – control flow returns immediately with a CompletableFuture.

run

(run tc tr-fn)

Takes a TransactionContext and a fn, and runs the function once against this Transaction. The call blocks while user code is executing, returning the result of that code on completion.

run-async!

(run-async! tc tr-fn)

Takes a TransactionContext and a fn. Depending on the type of context, this may execute the supplied function multiple times if an error is encountered. This call is non-blocking – control flow will return immediately with a CompletableFuture that will be set when the process is complete.

set

(set tr k v)

Sets the value for a given key.