AshCsvInterchange.Transformers.ValidateImportAction (AshCsvInterchange v0.1.0)

Copy Markdown View Source

Compile-time validation for AshCsvInterchange DSL config. For every csv_import entity declared on the resource:

  1. The configured upsert_action is a :create action declared on the resource with upsert? true and upsert_identity set.
  2. Every header input key resolves to an argument on the upsert action or an accepted attribute.
  3. No two header columns collide after whitespace trim and ASCII case-fold.
  4. Every upsert_identity key is an argument or an accepted attribute of the upsert action. This catches the typo case where an identity key has nowhere to land. Where the value comes from is the action author's concern.
  5. If import_source is set, its attribute exists on the resource.

Failures raise Spark.Error.DslError pointing at the offending entity.

Summary

Functions

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.

before?(_)

Callback implementation for Spark.Dsl.Transformer.before?/1.