ecto_mnesia v0.1.0 Ecto.Mnesia.Adapter
Ecto.Adapter for mnesia
Erlang term database.
It supports compound mnesia
indexes (aka secondary indexes) in database setup.
The implementation relies directly on mnesia
application.
Supports partial Ecto.Query to MatchSpec conversion for mnesia:select
(and, join).
MatchSpec converion utilities could be found in Ecto.Mnesia.Query
.
Configuration Sample
defmodule Sample.Model do
require Record
def keys, do: [id_seq: [:thing],
topics: [:whom,:who,:what],
config: [:key]]
def meta, do: [id_seq: [:thing, :id],
config: [:key, :value],
topics: Model.Topics.__schema__(:fields)]
end
where Model.Topics
is Ecto.Schema
object.
usage in config.exs
config :ecto, :mnesia_metainfo, Sample.Model
config :ecto, :mnesia_backend, :ram_copies
Summary
Functions
Retrieve all records from the given table using mnesia:all_keys
The name of the application is :ecto
Callback implementation for Ecto.Adapter.autogenerate/1
Callback implementation for Ecto.Adapter.child_spec/2
Delete Record of Ecto Schema Instace from mnesia database
Print directory of mnesia
tables on local node
Callback implementation for Ecto.Adapter.dumpers/2
Perform mnesia:select
on prepared query and convert the results to Ecto Schema
Insert Ecto Schema Instance to mnesia database
Callback implementation for Ecto.Adapter.insert_all/6
List of tables with compound (aka secondary indexes) keys: {table,keys}
Callback implementation for Ecto.Adapter.loaders/2
Default list of tables available for storage up: {table,fields}
Sequence autogeneration is implemented as mnesia:update_counter
Convert Ecto Qeury to Erlang MatchSpec, include caching
Mnesia starting during Adapter boot
Stopping Mnesia Adapter
Update Record of Ecto Schema Instance in mnesia database
Functions
Callback implementation for Ecto.Adapter.autogenerate/1
.
Callback implementation for Ecto.Adapter.child_spec/2
.
Callback implementation for Ecto.Adapter.dumpers/2
.
Perform mnesia:select
on prepared query and convert the results to Ecto Schema.
Callback implementation for Ecto.Adapter.insert_all/6
.
Callback implementation for Ecto.Adapter.loaders/2
.