Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run RavenDB Embedded in Memory

I haven't found in the documentation on how to do this with the Embedded server code. It recommended to use a json settings file however the documentation is clear where to put the json file or if it will work with the embedded version.

like image 872
bbqchickenrobot Avatar asked Oct 24 '25 16:10

bbqchickenrobot


1 Answers

Configuration in RavenDB (also embedded) can be set by settings file, environment variables, and command line arguments. Command line arguments will override the settings file and those will override environment variables. The default location of the settings file is inside the binaries folder. You can change that by command line argument -c="{PATH_TO_SETTINGS_FILE}". To pass command line arguments to embedded you can use its options:

EmbeddedServer.Instance.StartServer(new ServerOptions
{
    CommandLineArgs = new List<string>
    {
        "-c=\"{PATH_TO_CONFIGURATION_FILE}\"",
        "LogMode=\"Information\""
    }
});
Console.WriteLine("started");

Note: All the configurations passed by Raven.Embedded.ServerOptions are passed by the command line arguments and so will override other configuration sources for the same properties.

https://ravendb.net/docs/article-page/5.4/csharp/server/configuration/configuration-options https://ravendb.net/docs/article-page/5.4/csharp/server/configuration/command-line-arguments https://ravendb.net/docs/article-page/5.4/csharp/server/configuration/core-configuration

like image 198
Igal Merhavia Avatar answered Oct 27 '25 07:10

Igal Merhavia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!