Relatude Help

Finding the database and the model

Most commands start from the database's relatude.db.json (see section 12). The tool looks for relatude.settings/relatude.db.json in the current folder and in the folders above it. You can also point at it:

relatude info                            # nearest relatude.db.json, from here upwards
relatude info --project ../MyApp         # application folder or .csproj
relatude info --settings /srv/app/relatude.settings/relatude.db.json
relatude info --store "Reporting"        # when the file holds more than one database

The tool resolves the settings as the server does. Relative paths resolve against the folder that holds relatude.settings/. The admin UI's changes (relatude.db.overrides.json) apply, and so does the RelatudeDB section of appsettings.json, appsettings.{environment}.json and environment variables. --environment picks the environment; the default comes from DOTNET_ENVIRONMENT or ASPNETCORE_ENVIRONMENT, else Production.

The datamodel is not stored in the database files. It lives in your code, so the tool loads it. By default it follows the DatamodelSources in relatude.db.json and loads your assemblies from the newest build output under bin/, so build the project first. These options change where the model comes from:

Option What it does
--bin <folder> Load the application's assemblies from this folder
--assembly <file> Load this assembly; repeatable
--source <path> Compile .cs files, or a folder of them, in memory: inspect a model before the project builds
--namespace <ns> Add every model type in this namespace; repeatable
--model-type <name> Add one model type by full name, and everything it references

With --assembly or --source alone, the tool finds the model types by the Relatude attributes and member types they use. The engine's own model (Relatude.DB.Native.Models) is left out of the output unless you pass --include-native.