khepri_tx_adv (khepri v0.6.0)

Khepri advanced API for transactional queries and updates.

This module exposes variants of the functions in khepri_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

Link to this function

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 as khepri_adv:clear_many_payloads/2 but inside the context of a transaction function.

See also: khepri_adv:clear_many_payloads/2.

Link to this function

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 as khepri_adv:clear_many_payloads/3 but inside the context of a transaction function.

See also: khepri_adv:clear_many_payloads/3.

Link to this function

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 as khepri_adv:clear_payload/2 but inside the context of a transaction function.

See also: khepri_adv:clear_payload/2.

Link to this function

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 as khepri_adv:clear_payload/3 but inside the context of a transaction function.

See also: khepri_adv:clear_payload/3.

Link to this function

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 as khepri_adv:compare_and_swap/4 but inside the context of a transaction function.

See also: khepri_adv:compare_and_swap/4.

Link to this function

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 as khepri_adv:compare_and_swap/5 but inside the context of a transaction function.

See also: khepri_adv:compare_and_swap/5.

Link to this function

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 as khepri_adv:create/3 but inside the context of a transaction function.

See also: khepri_adv:create/3.

Link to this function

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 as khepri_adv:create/4 but inside the context of a transaction function.

See also: khepri_adv:create/4.

Link to this function

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 as khepri_adv:delete/2 but inside the context of a transaction function.

See also: khepri_adv:delete/2.

Link to this function

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 as khepri_adv:delete/3 but inside the context of a transaction function.

See also: khepri_adv:delete/3.

Link to this function

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 as khepri_adv:delete_many/2 but inside the context of a transaction function.

See also: khepri_adv:delete_many/2.

Link to this function

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 as khepri_adv:delete_many/3 but inside the context of a transaction function.

See also: khepri_adv:delete_many/3.

Link to this function

do_get_many(PathPattern, Fun, Acc, Options)

Link to this function

ensure_instruction_is_permitted(Unknown)

Link to this function

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 as khepri_adv:get/2 but inside the context of a transaction function.

See also: khepri_adv:get/2.

Link to this function

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 as khepri_adv:get/3 but inside the context of a transaction function.

See also: khepri_adv:get/3.

Link to this function

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 as khepri_adv:get_many/2 but inside the context of a transaction function.

See also: khepri_adv:get_many/2.

Link to this function

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 as khepri_adv:get_many/3 but inside the context of a transaction function.

See also: khepri_adv:get_many/3.

Link to this function

is_standalone_fun_still_needed(_, _)

Link to this function

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 as khepri_adv:put/3 but inside the context of a transaction function.

See also: khepri_adv:put/3.

Link to this function

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 as khepri_adv:put/4 but inside the context of a transaction function.

See also: khepri_adv:put/4.

Link to this function

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 as khepri_adv:put_many/3 but inside the context of a transaction function.

See also: khepri_adv:put_many/3.

Link to this function

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 as khepri_adv:put_many/4 but inside the context of a transaction function.

See also: khepri_adv:put_many/4.

Link to this function

should_process_function(Module, Name, Arity, FromModule)

Link to this function

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 as khepri_adv:update/3 but inside the context of a transaction function.

See also: khepri_adv:update/3.

Link to this function

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 as khepri_adv:update/4 but inside the context of a transaction function.

See also: khepri_adv:update/4.