Ash.Info (ash v3.5.39)

View Source

General introspection helpers for Ash applications.

Use Ash.Info.mermaid_overview(otp_app) to generate a mermaid chart of the application's domains and resources. This offers a high level view, but will not include information from extensions. Use resource_report/2 for a detailed report of a resource.

Use Ash.Info.mermaid_overview(otp_app, type: :entity_relationship) to get a simplified entity relationship diagram.

Use Ash.Info.domains_and_resources(otp_app) to get a map where the keys are the domains, and the value is the list of resources for that domain.

Summary

Functions

Returns a list of all defined extensions in the application.

Returns a map where the keys are the domains, and the value is the list of resources for that domain.

Returns a list of extensions in use by all the domains and resources in the given application.

Generate a mermaid chart of the application's domains and resources.

Functions

defined_extensions(app)

@spec defined_extensions(app :: Application.app()) :: [module()]

Returns a list of all defined extensions in the application.

Speed

This function will load all modules in the application, which can be slow. Do not call this function in time sensitive code paths, It is intended for mix tasks, introspection, and debugging purposes.

domains(otp_app)

@spec domains(atom()) :: [Ash.Domain.t()]

domains_and_resources(otp_app)

@spec domains_and_resources(atom()) :: %{
  required(Ash.Domain.t()) => [Ash.Resource.t()]
}

Returns a map where the keys are the domains, and the value is the list of resources for that domain.

extensions_in_use(app)

@spec extensions_in_use(app :: Application.app()) :: [module()]

Returns a list of extensions in use by all the domains and resources in the given application.

mermaid_overview(otp_app, type \\ :class)

Generate a mermaid chart of the application's domains and resources.

This offers a high level view, but will not include information from extensions.