View Source Igniter.Libs.Ecto (igniter v0.3.48)

Codemods & utilities for working with Ecto

Summary

Functions

Generates a new migration file for the given repo.

Lists all the ecto repos in the project

Selects a repo module from the list of available repos.

Functions

Link to this function

gen_migration(igniter, repo, name, opts \\ [])

View Source
@spec gen_migration(
  Igniter.t(),
  repo :: module(),
  name :: String.t(),
  opts :: Keyword.t()
) ::
  Igniter.t()

Generates a new migration file for the given repo.

Options

  • :body - the body of the migration
  • :timestamp - the timestamp to use for the migration. Primarily useful for testing so you know what the filename will be.
@spec list_repos(Igniter.t()) :: {Igniter.t(), [module()]}

Lists all the ecto repos in the project

Link to this function

select_repo(igniter, opts \\ [])

View Source
@spec select_repo(Igniter.t(), Keyword.t()) :: {Igniter.t(), nil | module()}

Selects a repo module from the list of available repos.

Options

  • :label - The label to display to the user when selecting the repo