EctoExtractMigrations (ecto_extract_migrations v0.2.0) View Source

The main entry point is lib/mix/tasks/ecto_extract_migrations.ex. This module mainly has common library functions.

Link to this section Summary

Functions

Evaluate template file with bindings

Evaluate template file with bindings

Convert schema qualified name in list format to binary

Parse line from SQL file (Stream.transform function)

Convert NimbleParsec result tuple into simple ok/error tuple

Convert SQL name to Elixir module name

Expand template file to path under priv/templates

Link to this section Functions

Link to this function

eval_template(template_file, bindings \\ [])

View Source

Specs

eval_template(Path.t(), Keyword.t()) :: {:ok, binary()} | {:error, term()}

Evaluate template file with bindings

Link to this function

eval_template_execute_sql(sql)

View Source
Link to this function

eval_template_execute_sql(up_sql, down_sql)

View Source
Link to this function

eval_template_file(template_file, bindings \\ [])

View Source

Specs

eval_template_file(Path.t(), Keyword.t()) :: {:ok, binary()} | {:error, term()}

Evaluate template file with bindings

Specs

module_parse({binary(), integer()}) :: {list(), nil | {module(), map()}}

Specs

module_parse({binary(), integer()}, [module()]) ::
  {list(), nil | {module(), map()}}

Specs

object_name(binary() | [binary()]) :: binary()

Convert schema qualified name in list format to binary

Specs

parse({binary(), integer()}, nil | {module(), binary()}) ::
  {list(), nil | {module(), binary()}}

Parse line from SQL file (Stream.transform function)

Specs

parsec_result(tuple()) :: {:ok, term()} | {:error, term()}

Convert NimbleParsec result tuple into simple ok/error tuple

Link to this function

sql_name_to_module(name)

View Source

Specs

sql_name_to_module(binary() | [binary()]) :: binary()

Convert SQL name to Elixir module name

Specs

template_path(Path.t()) :: Path.t()

Expand template file to path under priv/templates