AshReplicant.Resource (AshReplicant v0.2.0)

Copy Markdown View Source

Spark resource extension marking a host AshPostgres resource as a CDC mirror target for ash_replicant.

Add it to a host mirror resource:

use Ash.Resource,
  domain: MyApp.Domain,
  data_layer: AshPostgres.DataLayer,
  extensions: [AshReplicant.Resource]

replicant do
  source_table "orders"
  tenant_attribute :org_id
  sensitive [:pan]
end

source_table / source_schema default to the resource's own AshPostgres.DataLayer.Info.table/1 / schema/1 via AshReplicant.Resource.Info.source_table/1 and source_schema/1. Every option is optional. Compile-time verifiers enforce that sensitive columns map to encrypted/binary targets (ValidateSensitive), that a declared tenant_attribute is a plaintext, declared, non-classified discriminator (ValidateMultitenancy), and that a non-global multitenant resource declares a tenant source — tenant_attribute or tenant_mfa (ValidateTenantSource).

Summary

Functions

replicant(body)

(macro)