mnesia


Is there a built-in mechanism for us to launch Mnesia in Elixir?


It seems like that we can launch Mnesia only by typing iex --erl "--mnesia dir '~/doc/'" --name mynode.
Can we just launch it without passing arguments to erl?
You can set it up dynamically in your code. All the --erl instruction above does is to configure the mnesia application before it is started. You could achieve this by:
# First load mnesia
iex(1)> :application.load(:mnesia)
:ok
# Now configure the desired directory
iex(2)> :application.set_env(:mnesia, :dir, 'sample')
:ok
# Start mnesia as usual
iex(3)> :mnesia.start
:ok
# See if the desired info is correct
iex(4)> :mnesia.info
:ok
Notice it only works if you start the application manually. If you are starting it automatically and want to configure through the command line, your current snippet is the best option (or using ELIXIR_ERL_OPTS).

Related Links

Mesia activity/4 is reading only from the first fragment
Is there a built-in mechanism for us to launch Mnesia in Elixir?
how to use mnesia:select/4 and mnesia:select/1 for paging query
Querying mnesia Fragmentated Tables using QLC returns wrong results

Categories

HOME
opengl
android-espresso
focus
softlayer
semantic-web
autocomplete
jersey-2.0
elk-stack
linker
capistrano
anchor
swarm
vimeo
buffer
multi-step
live-streaming
jpa-2.0
django-rq
temperature
c#-7.0
word2vec
office-ui-fabric
significance
android-custom-view
yii2-basic-app
morris.js
pyspark-sql
fusion
envoy
locks
premake
mongoengine
rails-postgresql
orchardcms-1.8
nsuserdefaults
uivisualeffectview
strapi
llvm-ir
hidden-markov-models
gitolite
jacoco-maven-plugin
cloudera-sentry
distributed-caching
morphline
react-intl
common-table-expression
section508
roracle
beeline
amazon-elastic-beanstalk
gnome-terminal
pecl
.when
wildfly-9
tsqlt
raw-sockets
piping
processor
gridbaglayout
gravatar
deeplink
nastran
ambiguity
pythonxy
featuretoggle
dynamics-ax-2012-r2
debug-symbols
lifetime
symja
xcode6.3.1
prism.js
nodeload
roxy-fileman
colon
discovery
frontbase
sunstudio
unicoins
ui-design
asp.net-mvc-3-areas
significant-digits
chronometer
jzmq
exponent
fbml
representation
mediacontroller
3des
git-log
android-2.1-eclair
aggregator
sscli
self-tracking-entities
browser-based
.net-client-profile
main-method
html-generation

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App