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
spring-data
events
android-espresso
knockout.js
long-integer
theano
risk-management
openlayers-3
dronekit-python
tibco
mosquitto
hystrix
scrape
vimeo
google-awareness
complexity-theory
jaspersoft-studio
home
jitsi
fido-u2f
liferay-6.2
acl
device
vuforia
password-generator
uri
clipboard
openbravo
amazon-cloudtrail
spring-annotations
substance
premake
quickcheck
cloudera-manager
counting
markov-chains
cmis
rails-postgresql
xvfb
twilio-php
aurelia-http-client
extbase
flipkart
robust
type-inference
reverse-dns
daz3d
embedded-v8
kendo-editor
dex
mechanicalturk
mpmovieplayercontroller
instafeedjs
elastic4s
s-function
p6spy
wininet
xcode8-beta4
apache-pig-grunt
rails-engines
mathnet
linuxbrew
blank-line
android-studio-import
netdatacontractserializer
espresso
dbmigrate
kotlin-android-extensions
subfolder
fat32
sunos
back
reference-counting
iosched
application-blocks
indesign-server
acceptance-testing
rikulo
arel
ofstream
multiple-dispatch
daap
playorm
border-box
mvcrecaptcha
printqueue
regression-testing
libxslt
aptitude
chunking
pinax
icicles
.net-services
powergui
wmd-editor
xap
ning
index.dat
service-factory

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App