Squirrelix.Project (Squirrelix v0.4.0)

Copy Markdown View Source

Locates an Elixir Mix project and derives module names for generated SQL code.

Functions return standard {:ok, value} / {:error, reason} tuples. Reasons are plain atoms (:not_found, :invalid_mixfile, :invalid_sql_directory) rather than Gleam-style tagged error values.

Summary

Types

error_reason()

@type error_reason() :: :not_found | :invalid_mixfile | :invalid_sql_directory

Functions

app(root)

@spec app(Path.t()) :: {:ok, atom()} | {:error, :invalid_mixfile}

module_for_sql_directory(root, sql_directory)

@spec module_for_sql_directory(Path.t(), Path.t()) ::
  {:ok, module()} | {:error, :invalid_sql_directory}

root(start_path \\ File.cwd!())

@spec root(Path.t()) :: {:ok, Path.t()} | {:error, :not_found}

source_roots(root)

@spec source_roots(Path.t()) :: [Path.t()]