Packages
ecto_sql
3.13.2
3.14.0
3.13.5
3.13.4
3.13.3
3.13.2
3.13.1
3.13.0
3.12.1
3.12.0
3.11.3
3.11.2
3.11.1
3.11.0
3.10.2
3.10.1
3.10.0
3.9.2
3.9.1
3.9.0
3.8.3
3.8.2
3.8.1
3.8.0
3.7.2
3.7.1
3.7.0
3.6.2
3.6.1
3.6.0
3.5.4
3.5.3
3.5.2
3.5.1
3.5.0
3.5.0-rc.1
3.5.0-rc.0
3.4.5
3.4.4
3.4.3
3.4.2
3.4.1
3.4.0
3.3.4
3.3.3
3.3.2
3.3.1
3.3.0
3.2.2
3.2.1
3.2.0
3.1.6
3.1.5
3.1.4
3.1.3
3.1.2
3.1.1
3.1.0
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
3.0.0-rc.1
3.0.0-rc.0
SQL-based adapters for Ecto and database migrations
Current section
Files
Jump to
Current section
Files
lib/ecto/adapter/structure.ex
defmodule Ecto.Adapter.Structure do
@moduledoc """
Specifies the adapter structure (dump/load) API.
"""
@doc """
Dumps the given structure.
The path will be looked in the `config` under :dump_path or
default to the structure path inside `default`.
Returns an `:ok` tuple if it was dumped successfully, an error tuple otherwise.
## Examples
structure_dump("priv/repo", username: "postgres",
database: "ecto_test",
hostname: "localhost")
"""
@callback structure_dump(default :: String.t(), config :: Keyword.t()) ::
{:ok, String.t()} | {:error, term}
@doc """
Loads the given structure.
The path will be looked in the `config` under :dump_path or
default to the structure path inside `default`.
Returns an `:ok` tuple if it was loaded successfully, an error tuple otherwise.
## Examples
structure_load("priv/repo", username: "postgres",
database: "ecto_test",
hostname: "localhost")
"""
@callback structure_load(default :: String.t(), config :: Keyword.t()) ::
{:ok, String.t()} | {:error, term}
@doc """
Runs the dump command for the given repo / config.
Calling this function will setup authentication and run the dump cli
command with your provided `args`.
The options in `opts` are passed directly to `System.cmd/3`.
Returns `{output, exit_status}` where `output` is a string of the stdout
(as long as no option `into` is provided, see `System.cmd/3`) and `exit_status`
is the exit status of the invocation. (`0` for success)
## Examples
iex> dump_cmd(["--data-only", "--table", "table_name"], [stdout_to_stderr: true], Acme.Repo.config())
{"--\n-- PostgreSQL database dump\n--\n" <> _rest, 0}
"""
@callback dump_cmd(args :: [String.t()], opts :: Keyword.t(), config :: Keyword.t()) ::
{output :: Collectable.t(), exit_status :: non_neg_integer()}
end