AshCsvInterchange.Info (AshCsvInterchange v0.1.0)

Copy Markdown View Source

Introspection helpers for AshCsvInterchange-using resources.

Covers both directions: csv_import_types/1/csv_import_type/2 for import entities declared under csv_imports, and csv_export_types/1/csv_export_type/2 for export entities declared under csv_exports.

Summary

Functions

Looks up a single CSV export type on a resource by id. Returns :error if the resource doesn't declare a type with that id.

Returns every CSV export type declared on a resource. Returns [] for a resource that doesn't have the AshCsvInterchange extension.

Looks up a single CSV import type on a resource by id. Returns :error if the resource doesn't declare a type with that id.

Returns every CSV import type declared on a resource. Returns [] for a resource that doesn't have the AshCsvInterchange extension.

Functions

csv_export_type(resource, id)

@spec csv_export_type(module(), atom()) ::
  {:ok, AshCsvInterchange.Export.Type.t()} | :error

Looks up a single CSV export type on a resource by id. Returns :error if the resource doesn't declare a type with that id.

csv_export_types(resource)

@spec csv_export_types(module()) :: [AshCsvInterchange.Export.Type.t()]

Returns every CSV export type declared on a resource. Returns [] for a resource that doesn't have the AshCsvInterchange extension.

csv_import_type(resource, id)

@spec csv_import_type(module(), atom()) ::
  {:ok, AshCsvInterchange.Import.Type.t()} | :error

Looks up a single CSV import type on a resource by id. Returns :error if the resource doesn't declare a type with that id.

csv_import_types(resource)

@spec csv_import_types(module()) :: [AshCsvInterchange.Import.Type.t()]

Returns every CSV import type declared on a resource. Returns [] for a resource that doesn't have the AshCsvInterchange extension.