/
structure.ex
41 lines (29 loc) · 1.16 KB
/
structure.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 `:ok` 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 `:ok` 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}
end