Introspection for the AshReplicant.Resource extension.
Generates the replicant_<option>/1 ({:ok, value} | :error) and
replicant_<option>!/1 accessors for every option, plus the
reflection-fallback helpers source_table/1 and source_schema/1.
Summary
Functions
Policy for an upstream schema change: :halt_destructive (halt on destructive DDL) or :ignore.
Policy for an upstream schema change: :halt_destructive (halt on destructive DDL) or :ignore.
Policy for an upstream TRUNCATE: :halt (fail-closed) or :mirror (bulk-destroy the mirror rows in-txn).
Policy for an upstream TRUNCATE: :halt (fail-closed) or :mirror (bulk-destroy the mirror rows in-txn).
replicant DSL options
Source columns classified as sensitive. Verifier-enforced to map to an AshCloak-encrypted / binary-storage attribute, or to be listed in skip.
Source columns classified as sensitive. Verifier-enforced to map to an AshCloak-encrypted / binary-storage attribute, or to be listed in skip.
Source columns excluded from the mirror write.
Source columns excluded from the mirror write.
Source schema name. Defaults to the resource's own AshPostgres schema, else "public".
Source schema name. Defaults to the resource's own AshPostgres schema, else "public".
Source table name. Defaults to the resource's own AshPostgres table via reflection.
Source table name. Defaults to the resource's own AshPostgres table via reflection.
Source column carrying the tenant. Resolved per row and passed as tenant: to the mirror action. The source table must be REPLICA IDENTITY FULL so a delete's / PK-changing update's old_record carries the tenant column (key-only under the default identity → fail-closed :tenant_required).
Source column carrying the tenant. Resolved per row and passed as tenant: to the mirror action. The source table must be REPLICA IDENTITY FULL so a delete's / PK-changing update's old_record carries the tenant column (key-only under the default identity → fail-closed :tenant_required).
{m, f, a} where a is a list of extra args, applied as apply(m, f, [record | a]) yielding the tenant for a row.
{m, f, a} where a is a list of extra args, applied as apply(m, f, [record | a]) yielding the tenant for a row.
Identity name used for the upsert-by-PK mirror write.
Identity name used for the upsert-by-PK mirror write.
The source schema for the resource: the explicit source_schema, else the
resource's own AshPostgres schema via reflection, else "public".
The source table for the resource: the explicit source_table, else the
resource's own AshPostgres table via reflection.
Functions
@spec replicant_on_schema_change(dsl_or_extended :: module() | map()) :: {:ok, :ignore | :halt_destructive} | :error
Policy for an upstream schema change: :halt_destructive (halt on destructive DDL) or :ignore.
@spec replicant_on_schema_change!(dsl_or_extended :: module() | map()) :: (:ignore | :halt_destructive) | no_return()
Policy for an upstream schema change: :halt_destructive (halt on destructive DDL) or :ignore.
Policy for an upstream TRUNCATE: :halt (fail-closed) or :mirror (bulk-destroy the mirror rows in-txn).
@spec replicant_on_truncate!(dsl_or_extended :: module() | map()) :: (:mirror | :halt) | no_return()
Policy for an upstream TRUNCATE: :halt (fail-closed) or :mirror (bulk-destroy the mirror rows in-txn).
replicant DSL options
Returns a map containing the and any configured or default values.
Source columns classified as sensitive. Verifier-enforced to map to an AshCloak-encrypted / binary-storage attribute, or to be listed in skip.
Source columns classified as sensitive. Verifier-enforced to map to an AshCloak-encrypted / binary-storage attribute, or to be listed in skip.
Source columns excluded from the mirror write.
Source columns excluded from the mirror write.
Source schema name. Defaults to the resource's own AshPostgres schema, else "public".
Source schema name. Defaults to the resource's own AshPostgres schema, else "public".
Source table name. Defaults to the resource's own AshPostgres table via reflection.
Source table name. Defaults to the resource's own AshPostgres table via reflection.
Source column carrying the tenant. Resolved per row and passed as tenant: to the mirror action. The source table must be REPLICA IDENTITY FULL so a delete's / PK-changing update's old_record carries the tenant column (key-only under the default identity → fail-closed :tenant_required).
Source column carrying the tenant. Resolved per row and passed as tenant: to the mirror action. The source table must be REPLICA IDENTITY FULL so a delete's / PK-changing update's old_record carries the tenant column (key-only under the default identity → fail-closed :tenant_required).
@spec replicant_tenant_mfa(dsl_or_extended :: module() | map()) :: {:ok, {atom(), atom(), [any()]}} | :error
{m, f, a} where a is a list of extra args, applied as apply(m, f, [record | a]) yielding the tenant for a row.
@spec replicant_tenant_mfa!(dsl_or_extended :: module() | map()) :: {atom(), atom(), [any()]} | no_return()
{m, f, a} where a is a list of extra args, applied as apply(m, f, [record | a]) yielding the tenant for a row.
Identity name used for the upsert-by-PK mirror write.
Identity name used for the upsert-by-PK mirror write.
The source schema for the resource: the explicit source_schema, else the
resource's own AshPostgres schema via reflection, else "public".
The source table for the resource: the explicit source_table, else the
resource's own AshPostgres table via reflection.