How to change/set :mnesia folder in elixir?

986 views erlang
0

Is there a way to set mnesia folder in Elixir?

There is a way to set this folder using 'mnesia-dir' parameter in command line, but it is not a convenient way.

answered question

1 Answer

11

There are two ways:

1- Add it in your config.exs:

config :mnesia,
   dir: "mydb_#{Mix.env}" |> String.to_charlist

2- Use environments:

Application.put_env(:mnesia, :dir, '/tmp/wowdb')

posted this

Have an answer?

JD

Please login first before posting an answer.