Ecto v3.0.7 Ecto.Adapter.Storage behaviour View Source

Specifies the adapter storage API.

Link to this section Summary

Callbacks

Drops the storage given by options

Creates the storage given by options

Link to this section Callbacks

Link to this callback storage_down(options) View Source
storage_down(options :: Keyword.t()) ::
  :ok | {:error, :already_down} | {:error, term()}

Drops the storage given by options.

Returns :ok if it was dropped successfully.

Returns {:error, :already_down} if the storage has already been dropped or {:error, term} in case anything else goes wrong.

Examples

storage_down(username: postgres,
             database: 'ecto_test',
             hostname: 'localhost')
Link to this callback storage_up(options) View Source
storage_up(options :: Keyword.t()) ::
  :ok | {:error, :already_up} | {:error, term()}

Creates the storage given by options.

Returns :ok if it was created successfully.

Returns {:error, :already_up} if the storage has already been created or {:error, term} in case anything else goes wrong.

Examples

storage_up(username: postgres,
           database: 'ecto_test',
           hostname: 'localhost')