PgFlow.DSL.Validation (PgFlow v0.1.0)

Copy Markdown View Source

Compile-time validation helpers for PgFlow DSL macros.

Used internally by PgFlow.Flow and PgFlow.Job to validate module attributes during compilation.

Summary

Functions

Validates the cron option.

Functions

validate_cron_option!(schedule, env)

@spec validate_cron_option!(String.t() | keyword(), Macro.Env.t()) ::
  {String.t(), map()} | no_return()

Validates the cron option.

Accepts either:

  • A string shorthand: cron: "@hourly" (equivalent to cron: [schedule: "@hourly"])
  • A keyword list: cron: [schedule: "@hourly", input: %{key: "value"}]

Options when using keyword list:

  • :schedule is required and must be a valid cron expression string
  • :input is optional and must be a map (defaults to %{})

Returns {schedule, input} tuple on success.