Ecto.Adapter.Storage

Ecto.Adapter.Storage behaviour

Specifies the adapter storage API.

Summary

Callbacks

storage_down(options)

Drops the storage given by options

storage_up(options)

Creates the storage given by options

Callbacks

storage_down(options)

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

storage_up(options)

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

© 2012 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/ecto/Ecto.Adapter.Storage.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部