ecto_mnesia v0.8.0 Ecto.Mnesia.Storage

This module provides interface to manage Mnesia state and records data structure.

Summary

Functions

Checks that the Application environment for mnesia_dir is of a correct type

Start the Mnesia database

Stop the Mnesia database

Temporarily stops Mnesia, deletes schema and then brings it back up again

Creates the storage given by options

Functions

check_mnesia_dir()

Checks that the Application environment for mnesia_dir is of a correct type.

conf(config \\ [])
start()

Start the Mnesia database.

stop()

Stop the Mnesia database.

storage_down(config)

Temporarily stops Mnesia, deletes schema and then brings it back up again.

storage_up(config)

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.

Supported copy_type values: :disc_copies, :ram_copies, :disc_only_copies.

Examples

storage_up(host: `Kernel.node`, storage_type: :disc_copies)