khepri_tx_adv (khepri v0.6.0)
Khepri advanced API for transactional queries and updates.
This module exposes variants of the functions inkhepri_tx
which return more detailed return values for advanced use cases. See khepri_adv
for examples of use cases where this module could be useful.
Link to this section Summary
Functions
Deletes the payload of all tree nodes matching the given path pattern.
Deletes the payload of all tree nodes matching the given path pattern.
Deletes the payload of the tree node pointed to by the given path pattern.
Deletes the payload of the tree node pointed to by the given path pattern.
Updates an existing tree node with the given payload only if its data matches the given pattern.
Updates an existing tree node with the given payload only if its data matches the given pattern.
Creates a tree node with the given payload.
Creates a tree node with the given payload.
Deletes the tree node pointed to by the given path pattern.
Deletes the tree node pointed to by the given path pattern.
Deletes all tree nodes matching the given path pattern.
Deletes all tree nodes matching the given path pattern.
Returns the payload of the tree node pointed to by the given path pattern.
Returns the payload of the tree node pointed to by the given path pattern.
Returns payloads of all the tree nodes matching the given path pattern.
Returns payloads of all the tree nodes matching the given path pattern.
Runs the stored procedure pointed to by the given path and returns the result.
Runs the stored procedure pointed to by the given path and returns the result.
Sets the payload of all the tree nodes matching the given path pattern.
Sets the payload of all the tree nodes matching the given path pattern.
Updates an existing tree node with the given payload.
Updates an existing tree node with the given payload.
Link to this section Functions
clear_many_payloads(PathPattern)
-spec clear_many_payloads(PathPattern) -> Ret when PathPattern :: khepri_path:pattern(), Ret :: khepri_adv:many_results().
Deletes the payload of all tree nodes matching the given path pattern.
This is the same askhepri_adv:clear_many_payloads/2
but inside the context of a transaction function.See also: khepri_adv:clear_many_payloads/2.
clear_many_payloads(PathPattern, Options)
-spec clear_many_payloads(PathPattern, Options) -> Ret when PathPattern :: khepri_path:pattern(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:many_results().
Deletes the payload of all tree nodes matching the given path pattern.
This is the same askhepri_adv:clear_many_payloads/3
but inside the context of a transaction function.See also: khepri_adv:clear_many_payloads/3.
clear_payload(PathPattern)
-spec clear_payload(PathPattern) -> Ret when PathPattern :: khepri_path:pattern(), Ret :: khepri_adv:single_result().
Deletes the payload of the tree node pointed to by the given path pattern.
This is the same askhepri_adv:clear_payload/2
but inside the context of a transaction function.See also: khepri_adv:clear_payload/2.
clear_payload(PathPattern, Options)
-spec clear_payload(PathPattern, Options) -> Ret when PathPattern :: khepri_path:pattern(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:single_result().
Deletes the payload of the tree node pointed to by the given path pattern.
This is the same askhepri_adv:clear_payload/3
but inside the context of a transaction function.See also: khepri_adv:clear_payload/3.
compare_and_swap(PathPattern, DataPattern, Data)
-spec compare_and_swap(PathPattern, DataPattern, Data) -> Ret when PathPattern :: khepri_path:pattern(), DataPattern :: ets:match_pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Ret :: khepri_adv:single_result().
Updates an existing tree node with the given payload only if its data matches the given pattern.
This is the same askhepri_adv:compare_and_swap/4
but inside the context of a transaction function.See also: khepri_adv:compare_and_swap/4.
compare_and_swap(PathPattern, DataPattern, Data, Options)
-spec compare_and_swap(PathPattern, DataPattern, Data, Options) -> Ret when PathPattern :: khepri_path:pattern(), DataPattern :: ets:match_pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:single_result().
Updates an existing tree node with the given payload only if its data matches the given pattern.
This is the same askhepri_adv:compare_and_swap/5
but inside the context of a transaction function.See also: khepri_adv:compare_and_swap/5.
create(PathPattern, Data)
-spec create(PathPattern, Data) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Ret :: khepri_adv:single_result().
Creates a tree node with the given payload.
This is the same askhepri_adv:create/3
but inside the context of a transaction function.See also: khepri_adv:create/3.
create(PathPattern, Data, Options)
-spec create(PathPattern, Data, Options) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:single_result().
Creates a tree node with the given payload.
This is the same askhepri_adv:create/4
but inside the context of a transaction function.See also: khepri_adv:create/4.
delete(PathPattern)
-spec delete(PathPattern) -> Ret when PathPattern :: khepri_path:pattern(), Ret :: khepri_adv:single_result().
Deletes the tree node pointed to by the given path pattern.
This is the same askhepri_adv:delete/2
but inside the context of a transaction function.See also: khepri_adv:delete/2.
delete(PathPattern, Options)
-spec delete(PathPattern, Options) -> Ret when PathPattern :: khepri_path:pattern(), Options :: khepri:tree_options(), Ret :: khepri_adv:single_result().
Deletes the tree node pointed to by the given path pattern.
This is the same askhepri_adv:delete/3
but inside the context of a transaction function.See also: khepri_adv:delete/3.
delete_many(PathPattern)
-spec delete_many(PathPattern) -> Ret when PathPattern :: khepri_path:pattern(), Ret :: khepri_adv:many_results().
Deletes all tree nodes matching the given path pattern.
This is the same askhepri_adv:delete_many/2
but inside the context of a transaction function.See also: khepri_adv:delete_many/2.
delete_many(PathPattern, Options)
-spec delete_many(PathPattern, Options) -> Ret when PathPattern :: khepri_path:pattern(), Options :: khepri:tree_options(), Ret :: khepri_adv:many_results().
Deletes all tree nodes matching the given path pattern.
This is the same askhepri_adv:delete_many/3
but inside the context of a transaction function.See also: khepri_adv:delete_many/3.
do_get_many(PathPattern, Fun, Acc, Options)
ensure_instruction_is_permitted(Unknown)
get(PathPattern)
-spec get(PathPattern) -> Ret when PathPattern :: khepri_path:pattern(), Ret :: khepri_adv:single_result().
Returns the payload of the tree node pointed to by the given path pattern.
This is the same askhepri_adv:get/2
but inside the context of a transaction function.See also: khepri_adv:get/2.
get(PathPattern, Options)
-spec get(PathPattern, Options) -> Ret when PathPattern :: khepri_path:pattern(), Options :: khepri:tree_options(), Ret :: khepri_adv:single_result().
Returns the payload of the tree node pointed to by the given path pattern.
This is the same askhepri_adv:get/3
but inside the context of a transaction function.See also: khepri_adv:get/3.
get_many(PathPattern)
-spec get_many(PathPattern) -> Ret when PathPattern :: khepri_path:pattern(), Ret :: khepri_adv:many_results().
Returns payloads of all the tree nodes matching the given path pattern.
This is the same askhepri_adv:get_many/2
but inside the context of a transaction function.See also: khepri_adv:get_many/2.
get_many(PathPattern, Options)
-spec get_many(PathPattern, Options) -> Ret when PathPattern :: khepri_path:pattern(), Options :: khepri:tree_options(), Ret :: khepri_adv:many_results().
Returns payloads of all the tree nodes matching the given path pattern.
This is the same askhepri_adv:get_many/3
but inside the context of a transaction function.See also: khepri_adv:get_many/3.
is_standalone_fun_still_needed(_, _)
put(PathPattern, Data)
-spec put(PathPattern, Data) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Ret :: khepri_adv:single_result().
Runs the stored procedure pointed to by the given path and returns the result.
This is the same askhepri_adv:put/3
but inside the context of a transaction function.See also: khepri_adv:put/3.
put(PathPattern, Data, Options)
-spec put(PathPattern, Data, Options) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:single_result().
Runs the stored procedure pointed to by the given path and returns the result.
This is the same askhepri_adv:put/4
but inside the context of a transaction function.See also: khepri_adv:put/4.
put_many(PathPattern, Data)
-spec put_many(PathPattern, Data) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Ret :: khepri_adv:many_results().
Sets the payload of all the tree nodes matching the given path pattern.
This is the same askhepri_adv:put_many/3
but inside the context of a transaction function.See also: khepri_adv:put_many/3.
put_many(PathPattern, Data, Options)
-spec put_many(PathPattern, Data, Options) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:many_results().
Sets the payload of all the tree nodes matching the given path pattern.
This is the same askhepri_adv:put_many/4
but inside the context of a transaction function.See also: khepri_adv:put_many/4.
should_process_function(Module, Name, Arity, FromModule)
update(PathPattern, Data)
-spec update(PathPattern, Data) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Ret :: khepri_adv:single_result().
Updates an existing tree node with the given payload.
This is the same askhepri_adv:update/3
but inside the context of a transaction function.See also: khepri_adv:update/3.
update(PathPattern, Data, Options)
-spec update(PathPattern, Data, Options) -> Ret when PathPattern :: khepri_path:pattern(), Data :: khepri_payload:payload() | khepri:data() | fun(), Options :: khepri:tree_options() | khepri:put_options(), Ret :: khepri_adv:single_result().
Updates an existing tree node with the given payload.
This is the same askhepri_adv:update/4
but inside the context of a transaction function.See also: khepri_adv:update/4.