Xitdb.Ash.Info (xitdb v1.0.1)

Copy Markdown View Source

Compile-time and runtime introspection helpers for Xitdb.Ash.Resource.

Summary

Functions

Returns the deduplicated list of editable and computed Xitdb field names as strings for one or more Xitdb.Ash.Resource modules, applying any configured field_aliases.

Returns the deduplicated list of Xitdb slot atoms ([:id | editable ++ passthru]) for one or more Xitdb.Ash.Resource modules, applying any configured field_aliases.

Compiles a structural Xitdb.Pull pattern string for one or more Xitdb.Ash.Resource modules.

Resolves the Ash.Resource.Change module for locking/unlocking fields from the resource's xitdb.lock_change option or Application.get_env(:xitdb, :default_lock_change).

Resolves the target Xitdb store server from context[:xitdb_store], keyword opts[:store], the resource's xitdb.store option, or Application.get_env(:xitdb, :default_store).

Primary Xitdb hash_map collection (:organizations, :people, :events).

Primary Xitdb hash_map collection (:organizations, :people, :events).

Optional companion resource sharing the same Xitdb entity (e.g. Profile <-> User).

Optional companion resource sharing the same Xitdb entity (e.g. Profile <-> User).

Derived Xitdb-only fields maintained by the engine (e.g. :normalized_name, :activity_count).

Derived Xitdb-only fields maintained by the engine (e.g. :normalized_name, :activity_count).

Canonical attributes subject to per-field survivorship locks and conflict detection.

Canonical attributes subject to per-field survivorship locks and conflict detection.

Maps Ash attribute names to Xitdb slot names (e.g. [parent_organization_id: :parent_org_id]).

Maps Ash attribute names to Xitdb slot names (e.g. [parent_organization_id: :parent_org_id]).

Attributes accepted by sync_update_action that are bookkeeping metadata rather than projected Xitdb fields.

Attributes accepted by sync_update_action that are bookkeeping metadata rather than projected Xitdb fields.

Secondary B+Tree index declarations ([domain: "domain->org_id", ...]).

Secondary B+Tree index declarations ([domain: "domain->org_id", ...]).

Ash update action that locks a single field.

Ash update action that locks a single field.

Ash.Resource.Change module automatically wired into lock_action and unlock_action (defaults to config :xitdb, :default_lock_change).

Ash.Resource.Change module automatically wired into lock_action and unlock_action (defaults to config :xitdb, :default_lock_change).

Curation counted_hash_set tracking locked entity IDs (:locked_org_ids, etc.).

Curation counted_hash_set tracking locked entity IDs (:locked_org_ids, etc.).

Sorted map storing loser -> winner redirects (:org_merged_into, :merged_into).

Sorted map storing loser -> winner redirects (:org_merged_into, :merged_into).

xitdb DSL options

Attributes projected into Xitdb without per-field conflict logging (e.g. :creatio_id).

Attributes projected into Xitdb without per-field conflict logging (e.g. :creatio_id).

Default Xitdb Store GenServer name (overridable via context[:xitdb_store] or config :xitdb, :default_store).

Default Xitdb Store GenServer name (overridable via context[:xitdb_store] or config :xitdb, :default_store).

Ash update action invoked by reconciler projectors.

Ash update action invoked by reconciler projectors.

Ash update action that unlocks a single field.

Ash update action that unlocks a single field.

Functions

editable_field_strings(resources)

@spec editable_field_strings(Ash.Resource.t() | [Ash.Resource.t()]) :: [String.t()]

Returns the deduplicated list of editable and computed Xitdb field names as strings for one or more Xitdb.Ash.Resource modules, applying any configured field_aliases.

pull_fields(resources)

@spec pull_fields(Ash.Resource.t() | [Ash.Resource.t()]) :: [atom()]

Returns the deduplicated list of Xitdb slot atoms ([:id | editable ++ passthru]) for one or more Xitdb.Ash.Resource modules, applying any configured field_aliases.

pull_pattern_for(pair)

@spec pull_pattern_for(Ash.Resource.t() | [Ash.Resource.t()]) :: String.t()

Compiles a structural Xitdb.Pull pattern string for one or more Xitdb.Ash.Resource modules.

resolve_lock_change(resource)

@spec resolve_lock_change(Ash.Resource.t() | Spark.Dsl.t()) :: module() | nil

Resolves the Ash.Resource.Change module for locking/unlocking fields from the resource's xitdb.lock_change option or Application.get_env(:xitdb, :default_lock_change).

resolve_store(resource, opts)

@spec resolve_store(Ash.Resource.t(), map() | keyword()) :: GenServer.server() | nil

Resolves the target Xitdb store server from context[:xitdb_store], keyword opts[:store], the resource's xitdb.store option, or Application.get_env(:xitdb, :default_store).

xitdb_collection(dsl_or_extended)

@spec xitdb_collection(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error

Primary Xitdb hash_map collection (:organizations, :people, :events).

xitdb_collection!(dsl_or_extended)

@spec xitdb_collection!(dsl_or_extended :: module() | map()) :: atom() | no_return()

Primary Xitdb hash_map collection (:organizations, :people, :events).

xitdb_companion_resource(dsl_or_extended)

@spec xitdb_companion_resource(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

Optional companion resource sharing the same Xitdb entity (e.g. Profile <-> User).

xitdb_companion_resource!(dsl_or_extended)

@spec xitdb_companion_resource!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

Optional companion resource sharing the same Xitdb entity (e.g. Profile <-> User).

xitdb_computed_xitdb_fields(dsl_or_extended)

@spec xitdb_computed_xitdb_fields(dsl_or_extended :: module() | map()) ::
  {:ok, [atom()]} | :error

Derived Xitdb-only fields maintained by the engine (e.g. :normalized_name, :activity_count).

xitdb_computed_xitdb_fields!(dsl_or_extended)

@spec xitdb_computed_xitdb_fields!(dsl_or_extended :: module() | map()) ::
  [atom()] | no_return()

Derived Xitdb-only fields maintained by the engine (e.g. :normalized_name, :activity_count).

xitdb_editable_fields(dsl_or_extended)

@spec xitdb_editable_fields(dsl_or_extended :: module() | map()) ::
  {:ok, [atom()]} | :error

Canonical attributes subject to per-field survivorship locks and conflict detection.

xitdb_editable_fields!(dsl_or_extended)

@spec xitdb_editable_fields!(dsl_or_extended :: module() | map()) ::
  [atom()] | no_return()

Canonical attributes subject to per-field survivorship locks and conflict detection.

xitdb_field_aliases(dsl_or_extended)

@spec xitdb_field_aliases(dsl_or_extended :: module() | map()) ::
  {:ok, keyword()} | :error

Maps Ash attribute names to Xitdb slot names (e.g. [parent_organization_id: :parent_org_id]).

xitdb_field_aliases!(dsl_or_extended)

@spec xitdb_field_aliases!(dsl_or_extended :: module() | map()) ::
  keyword() | no_return()

Maps Ash attribute names to Xitdb slot names (e.g. [parent_organization_id: :parent_org_id]).

xitdb_ignored_sync_attributes(dsl_or_extended)

@spec xitdb_ignored_sync_attributes(dsl_or_extended :: module() | map()) ::
  {:ok, [atom()]} | :error

Attributes accepted by sync_update_action that are bookkeeping metadata rather than projected Xitdb fields.

xitdb_ignored_sync_attributes!(dsl_or_extended)

@spec xitdb_ignored_sync_attributes!(dsl_or_extended :: module() | map()) ::
  [atom()] | no_return()

Attributes accepted by sync_update_action that are bookkeeping metadata rather than projected Xitdb fields.

xitdb_indexes(dsl_or_extended)

@spec xitdb_indexes(dsl_or_extended :: module() | map()) :: {:ok, keyword()} | :error

Secondary B+Tree index declarations ([domain: "domain->org_id", ...]).

xitdb_indexes!(dsl_or_extended)

@spec xitdb_indexes!(dsl_or_extended :: module() | map()) :: keyword() | no_return()

Secondary B+Tree index declarations ([domain: "domain->org_id", ...]).

xitdb_lock_action(dsl_or_extended)

@spec xitdb_lock_action(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error

Ash update action that locks a single field.

xitdb_lock_action!(dsl_or_extended)

@spec xitdb_lock_action!(dsl_or_extended :: module() | map()) :: atom() | no_return()

Ash update action that locks a single field.

xitdb_lock_change(dsl_or_extended)

@spec xitdb_lock_change(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error

Ash.Resource.Change module automatically wired into lock_action and unlock_action (defaults to config :xitdb, :default_lock_change).

xitdb_lock_change!(dsl_or_extended)

@spec xitdb_lock_change!(dsl_or_extended :: module() | map()) :: atom() | no_return()

Ash.Resource.Change module automatically wired into lock_action and unlock_action (defaults to config :xitdb, :default_lock_change).

xitdb_locked_ids_set(dsl_or_extended)

@spec xitdb_locked_ids_set(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

Curation counted_hash_set tracking locked entity IDs (:locked_org_ids, etc.).

xitdb_locked_ids_set!(dsl_or_extended)

@spec xitdb_locked_ids_set!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

Curation counted_hash_set tracking locked entity IDs (:locked_org_ids, etc.).

xitdb_merge_redirect_collection(dsl_or_extended)

@spec xitdb_merge_redirect_collection(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

Sorted map storing loser -> winner redirects (:org_merged_into, :merged_into).

xitdb_merge_redirect_collection!(dsl_or_extended)

@spec xitdb_merge_redirect_collection!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

Sorted map storing loser -> winner redirects (:org_merged_into, :merged_into).

xitdb_options(dsl_or_extended)

@spec xitdb_options(dsl_or_extended :: module() | map()) :: %{
  required(atom()) => any()
}

xitdb DSL options

Returns a map containing the and any configured or default values.

xitdb_passthru_fields(dsl_or_extended)

@spec xitdb_passthru_fields(dsl_or_extended :: module() | map()) ::
  {:ok, [atom()]} | :error

Attributes projected into Xitdb without per-field conflict logging (e.g. :creatio_id).

xitdb_passthru_fields!(dsl_or_extended)

@spec xitdb_passthru_fields!(dsl_or_extended :: module() | map()) ::
  [atom()] | no_return()

Attributes projected into Xitdb without per-field conflict logging (e.g. :creatio_id).

xitdb_store(dsl_or_extended)

@spec xitdb_store(dsl_or_extended :: module() | map()) :: {:ok, atom()} | :error

Default Xitdb Store GenServer name (overridable via context[:xitdb_store] or config :xitdb, :default_store).

xitdb_store!(dsl_or_extended)

@spec xitdb_store!(dsl_or_extended :: module() | map()) :: atom() | no_return()

Default Xitdb Store GenServer name (overridable via context[:xitdb_store] or config :xitdb, :default_store).

xitdb_sync_update_action(dsl_or_extended)

@spec xitdb_sync_update_action(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

Ash update action invoked by reconciler projectors.

xitdb_sync_update_action!(dsl_or_extended)

@spec xitdb_sync_update_action!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

Ash update action invoked by reconciler projectors.

xitdb_unlock_action(dsl_or_extended)

@spec xitdb_unlock_action(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

Ash update action that unlocks a single field.

xitdb_unlock_action!(dsl_or_extended)

@spec xitdb_unlock_action!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

Ash update action that unlocks a single field.