AshArcadic.Replicant (AshArcadic v0.2.0)

Copy Markdown View Source

Spark resource extension marking a host AshArcadic.DataLayer graph resource as a replicant CDC mirror target — declares which Postgres {schema, table} this resource mirrors.

Add it to a host graph resource:

use Ash.Resource,
  domain: MyApp.Domain,
  data_layer: AshArcadic.DataLayer,
  extensions: [AshArcadic.Replicant]

replicant do
  source_table "orders"
  tenant_attribute :org_id
  skip [:internal_notes]
end

Diverges from the sibling ash_replicant's AshReplicant.Resource (its resource.ex is the design template — same %Spark.Dsl.Section{} + use Spark.Dsl.Extension idiom) in these deliberate ways:

  • source_table is required, with no reflection fallback — a graph resource's own arcade do label ... end is NOT its Postgres source table, so the mapping must be declared explicitly.
  • source_schema defaults to the static string "public" (no reflection).
  • on_truncate supports only :halt (default, fail-closed) and :mirror — the precedent's SCD2-only :close value is dropped (no SCD2 target-side support this slice).
  • Only source_schema, source_table, tenant_attribute, skip, and on_truncate are exposed. tenant_mfa, sensitive, upsert_identity, history_*, and on_schema_change are out of scope — sensitive classification is handled target-side by the existing arcade do sensitive ... end section, not a replicant-section list.
  • skip here names source (Postgres) columns excluded from the mirror write — distinct from arcade do skip ... end, which names target (ArcadeDB) graph attributes.

Summary

Functions

replicant(body)

(macro)