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
rust
weblogic12c
long-integer
braintree
ant
apk
nsis
swift2
phpseclib
telegraf
jpa-criteria
gtk
hystrix
locationmanager
parsley.js
responsivevoice
amazon-elb
heap-dump
pinterest
home
clr
dashdb
bosun
chronicle-queue
jpa-2.1
sap-lumira
openbravo
oracleforms
adapter
matlab-app-designer
vcenter
opnet
riotjs
knights-tour
shapeless
ms-media-foundation
counting
java-stream
db2-luw
express-session
textmate2
twilio-php
microkernel
jacoco-maven-plugin
klee
code-push
icecast
nothing
test-data
mobile-angular-ui
clrs
dblink
alertify
java-2d
livecycle
django-testing
perforce-integrate
django-redis
onepage-checkout
wif4.5
diawi
ajax4jsf
lovefield
phpquery
apache-commons-digester
calcite
wso2ml
unhandled
replicaset
modern.ie
explain
kefir.js
deque
tidyr
nhibernate-criteria
comctl32
symja
zend-mail
jquery-mobile-flipswitch
box2dweb
.htpasswd
commenting
refit
strdup
cloo
particle-swarm
san
jquery-transit
node.js-stream
html-frames
user-forums
xcode4.5
playorm
instance-variables
delphi-prism
filelock
data-dump
rtd
pyjamas
icicles
reliability
ixmldomdocument
processors
database-cloning

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