AshScylla.SchemaLoader (AshScylla v1.4.1)

Copy Markdown View Source

Loads and discovers schema migration modules from priv/<repo>/migrations.

Discovery

discover/0 scans all apps (current + umbrella) for .ex files under priv/<repo>/migrations/ and returns sorted file paths.

Loading

load/1 requires the file, checks for change/0, and calls AshScylla.Schema.flatten/1 to normalize the result to a flat CQL list.

Supports both flat CQL string lists and struct-based %AshScylla.Schema{} entries.

Summary

Functions

Discovers all .ex files under priv/<repo>/migrations for the current project.

Loads a schema module from a file path and returns its change/0 statements.

Types

loaded()

@type loaded() :: {:ok, module()} | {:error, term()}

Functions

discover()

@spec discover() :: [String.t()]

Discovers all .ex files under priv/<repo>/migrations for the current project.

load(path)

@spec load(String.t()) :: {:ok, [String.t()]} | {:error, term()}

Loads a schema module from a file path and returns its change/0 statements.

Supports both flat CQL string lists and struct-based %AshScylla.Schema{} entries. Struct-based entries are automatically flattened via AshScylla.Schema.flatten/1.