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
mod-rewrite
verification
scroll
mousemove
plpgsql
web2py
dependencies
flurry
position
ag-grid
lapack
multi-step
playframework-2.0
scala-ide
cloudsim
spyder
angular2-highcharts
yii2-basic-app
tableview
sqlplus
hdl
mime-types
websphere-portal
eclipse-emf
firemonkey-style
password-generator
running-object-table
marquee
bobo-browse.net
amazon-cloudtrail
mdns
matlab-app-designer
winsock
bootstrap-sass
nppexec
subclassing
netstat
jade4j
ms-solver-foundation
cargo
nanogallery
windows-store
oauth2-playground
flipkart
yoast
dbcc
destroy
gcal
cyanogenmod
md5-file
popen
word-2007
bilinear-interpolation
spring-mongo
timestamping
gravatar
odesk
bayesglm
miniconda
variable-length-array
opencyc
ruby-on-rails-4.1
sqlbase
hmisc
search-form
vdm-sl
bootstrap-wysiwyg
algebraixlib
karma-coverage
encryption-symmetric
dc
global-scope
csslint
xmi
ggts
ember-table
html-frames
aero
days
significant-digits
lynx
towers-of-hanoi
onconfigurationchanged
struts2-json-plugin
coordinate
websphere-6.1
liveconnect
differentiation
delphi-prism
firefly-mv
fork-join
canonicalization
mediacontroller
multiple-users
ccnet-config
pinax
projectpier
main-method
downcasting
ntruencrypt
twitter-feed
acceleration
isapi-redirect

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile