AshR2RML.DataLayer (AshR2RML v26.8.22)

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

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

Extracts database schema name if configured on data layer.

Extracts physical relational table name from resource data layer metadata.

Functions

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 relational table name from resource data layer metadata.