ecto_mnesia v0.2.0 Ecto.Mnesia.Storage
This module provides interface to manage Mnesia state and records data structure.
Summary
Functions
Creates table secondary indexes
Creates a table
Creates tables and indexes from a Ecto.Mnesia meta-schema
Start the Mnesia database
This is dirty hack for Ecto that is trying to receive child spec from adapter, and we don’t have any workers and supervisors that needs to be added to tree (Mnesia is a separate OTP app)
Stop the Mnesia database
Callback implementation for Ecto.Adapter.Storage.storage_down/1
Creates the storage given by options
Functions
Creates tables and indexes from a Ecto.Mnesia meta-schema.
This is dirty hack for Ecto that is trying to receive child spec from adapter, and we don’t have any workers and supervisors that needs to be added to tree (Mnesia is a separate OTP app).
So we simply handle whatever Repo.Supervisor is sending to us and initiating Mnesia tables.
Callback implementation for Ecto.Adapter.Storage.storage_down/1
.
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`,
copy_type: :,
hostname: 'localhost')