Ecto v2.2.9 Ecto.Adapter.Structure behaviour View Source

Specifies the adapter structure API.

Link to this section Summary

Callbacks

Dumps the given structure

Loads the given structure

Link to this section Callbacks

Link to this callback structure_dump(default, config) View Source
structure_dump(default :: String.t(), config :: Keyword.t()) ::
  {:ok, String.t()} | {:error, term()}

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 loaded successfully, an error tuple otherwise.

Examples

structure_dump("priv/repo", username: "postgres",
                            database: "ecto_test",
                            hostname: "localhost")
Link to this callback structure_load(default, config) View Source
structure_load(default :: String.t(), config :: Keyword.t()) ::
  {:ok, String.t()} | {:error, term()}

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")