Loads and writes Elixir query metadata files for the current code generation pipeline.
Metadata files are evaluated with Code.eval_string/3 and must return a map.
Treat them like mix.exs / config/*.exs: only load trusted, project-local
files. Prefer --infer in CI when you do not want to maintain evaluated Elixir
metadata.
Use to_file/3 (or Mix --infer --write-metadata PATH) to capture inferred
types for offline mix squirrelix.check / gen without Postgres.
Summary
Functions
Serializes a metadata map to formatted Elixir source with relative query paths.
Builds a metadata map (absolute query paths) from typed query directories.
Writes a metadata map as evaluated Elixir to file.
Functions
Serializes a metadata map to formatted Elixir source with relative query paths.
@spec from_file( Path.t(), keyword() ) :: {:ok, %{required(String.t()) => keyword()}} | {:error, Squirrelix.Error.CannotReadFile.t() | Squirrelix.Error.InvalidQueryMetadataFile.t()}
@spec from_typed_directories([Squirrelix.TypedQueryDirectory.t()]) :: %{ required(Path.t()) => keyword() }
Builds a metadata map (absolute query paths) from typed query directories.
The result is suitable for Squirrelix.generate/3 / check/3 and for
to_file/3.
@spec to_file(Path.t(), %{required(Path.t()) => keyword()}, keyword()) :: :ok | {:error, Squirrelix.Error.CannotWriteFile.t()}
Writes a metadata map as evaluated Elixir to file.
Query paths are written relative to :root when possible. Parent directories
are created as needed. Overwrites any existing file at file.