AshR2RML.DataLayer (AshR2RML v26.8.29)

Copy Markdown View Source

Automatic Data Layer Introspection helper for Ash resources.

Extracts physical database storage details (table name, schema, repo, child/parent join columns) directly from active Ash data layers (such as AshPostgres.DataLayer or Ash.DataLayer.Ets) to prevent redundant DSL annotations.

Summary

Functions

Identifies which Ash data layer backs a resource: :postgres, :ets, or :unknown.

Infers relationship join child and parent column names from Ash relationship metadata.

Extracts database schema name if configured on data layer.

Extracts physical table name from resource data layer metadata.

Functions

backend(resource)

@spec backend(module()) :: :postgres | :ets | :unknown

Identifies which Ash data layer backs a resource: :postgres, :ets, or :unknown.

infer_join_columns(resource, relationship)

@spec infer_join_columns(module(), Ash.Resource.Relationships.relationship() | map()) ::
  {String.t(), String.t()}

Infers relationship join child and parent column names from Ash relationship metadata.

schema_name(resource)

@spec schema_name(module()) :: String.t() | nil

Extracts database schema name if configured on data layer.

table_name(resource)

@spec table_name(module()) :: String.t()

Extracts physical table name from resource data layer metadata.