Is there ways to specify path to schema in cowboy app? Maybe it's possible to set in my_app.app.src or any config file?
How to specify directory for mnesia in cowboy application?
1.8k Views Asked by Don Lino At
2
There are 2 best solutions below
Related Questions in ERLANG
- Using gleam, cannot import 'gleam/otp/process'
- Zig Concurrency Vs Erlang Concurrency, is Zig less efficient than Erlang?
- Creaating a new Key Value dict from previous dict
- How to execute an exit function before closing rebar3 shell?
- rebar3 does not compile anything in `src` directory
- Ejabberd Migration from 23 to 24
- How to use compiled erlang modules in an elixir project?
- ejabberd_sql:handle_reconnect/2:491 odbc connection failed ejabberd
- Lisp Flavored Erlang: Can't find include lib include/ltest-macros.lfe
- Signing key for RabbitMQ
- Rabbitmq fails to start and getting Erlang eaacces error
- Erlang: binary_to_term explanation
- How to extend emqx clientInfo to get more fields during HTTP Authorization
- Transforming `erl_parse:abstract_form()` to `erl_syntax:syntaxTree()`
- Who is the sender of Erlang's trace messages and what can I assume based on it?
Related Questions in MNESIA
- How to stop messages from piling up in msg_store_persistent in mnesia folder?
- Erlang, creating mnesia table index
- How does mnesia sync disc_copies with other nodes / PCs?
- ejabberd server overloads at 1080 active users
- init / sync mnesia on distributed rebar3 app
- Erlang: how to spawn a node and link it to a mnesia table
- load an existing mnesia db from files .DCD .DCL
- Erlang rebar3 builds
- Erlang database server nodedown error, can not get mnesia database data through database logic
- Select data rows with condition Erlang
- Reading history on the server ejabberd (mnesia)
- Mneisa table memory does not match size in DCD file
- How to test mnesia system events
- High erlang process memory executing mnesia:dirty_select/2
- Erlang Database Join Association
Related Questions in COWBOY
- How to send MIME (Multipart Media Encapsulation) content type message using erlang HTTP method?
- Issue with running a compiled rebar3 erlang application with erl -pa
- Failed to start Ranch listener https_listener in ranch_ssl:listen, for reason eacces (permission denied) on Linux
- cowboy_websocket:websocket_send argument problem
- Cowboy 2.9.0 reverse proxy websockets
- How do I do something before the request dispatcher in cowboy?
- Erlang cowboy matching multiple routes
- Can I write Erlang modules in Phoenix?
- Creating a minimal Plug based http server in an exs file
- How do I get the cowboy ssl hello world example to run?
- Erlang Cowboy crashing. How to change logging levels?
- Cowboy framework: Sending HTTP calls
- How to create a keep-alive API endpoint with Cowboy in Elixir?
- How would I allow CORS with plug_cowboy in Elixir?
- Cowboy/Ranch kills handler process when client closes connection
Related Questions in RELX
- Where do I call mnesia:create_schema/1 in a relx release?
- how to include .hrl files across multiple modules rebar3
- Cannot expand $ERTS_LIB_DIR in bootfile
- How to use OS environment variables in rebar3
- How can I include a ".mustache" file in erlang release?
- Connecting to a running Erlang application release in a docker container
- erlang dbg module not work when use relx
- Erlang app fails to start with {compile_forms,error} from lager
- Package management on Erlang and Elixir
- Erlang "Kernel pid terminated" error
- Starting Erlang service at boot time (using Relx for creating release)
- Erlang release, set node name for ./bin/XXXXX start -name nonode@nohost
- Erlang relx: add appmon but told application already started
- OTP - Adding Couchbeam as a dependency - ** exception error: undefined function jsx:decode/1
- Error when start erlang application (relx) release
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The path to the mnesia directory has to be provided to erlang VM before mnesia application is started through application configuration parameters. In Mnesia tutorial, this is done with the
-Application par valVM arguments syntax.What you call a cowboy application is probably an Erlang OTP release (built by relx as per cowboy tutorial). The solutions, quickly described in Cowboy issue #595, are as follows.
The choice between solutions really depends on style as well as some constraints. Any sufficiently complex release would use a configuration file, so it would be a good choice.
vm.argsseems easier to deal with. Eventually, you might need to alter the start script (for example to run several nodes from a single deployment), and include some logic to define the mnesia directory.Provide relx with a configuration file (sys_config option)
To do so, add the following term to
relx.configas documented.sys.configactually is a standard Erlang configuration file, also documented. Specifying mnesia dir is done by adding a section for mnesia application. If no other configuration is required, the file would be:Get relx to pass arguments to the vm (vm_args option)
The
vm.argsfile is actually passed to the VM through-args_fileoption. This is a simple text file with arguments.You would add the following term to
relx.configas documented.And put the following content in the
vm.argsfile:Write your own start script
relxactually creates a start script, which passes-config sys.configandargs_file vm.argsto the VM as required. You could modify this script or roll your own to actually pass the-mnesia dirargument to the VM.