5 unstable releases

0.13.0-alpha Apr 9, 2024
0.12.0-alpha.1 Apr 2, 2024
0.12.0-alpha Mar 18, 2024
0.11.0 Apr 9, 2024
0.11.0-rc.2 Apr 2, 2024

#559 in Database interfaces

Download history 99/week @ 2024-03-14 20/week @ 2024-03-21 177/week @ 2024-03-28 229/week @ 2024-04-04 41/week @ 2024-04-11

170 downloads per month
Used in 2 crates (via opentalk-database)

EUPL-1.2

19KB
468 lines

Contains the application settings.

The application settings are set with a TOML config file. Settings specified in the config file can be overwritten by environment variables. To do so, set an environment variable with the prefix OPENTALK_CTRL_ followed by the field names you want to set. Nested fields are separated by two underscores __.

OPENTALK_CTRL_<field>__<field-of-field>...

Example

set the database.url field:

OPENTALK_CTRL_DATABASE__URL=postgres://postgres:password123@localhost:5432/opentalk

So the field 'database.max_connections' would resolve to:

OPENTALK_CTRL_DATABASE__MAX_CONNECTIONS=5

Note

Fields set via environment variables do not affect the underlying config file.

Implementation Details:

Setting categories, in which all properties implement a default value, should also implement the Default trait.

Dependencies

~32–44MB
~513K SLoC