After office politics, you decide that you want to use MySQL by default.
You no longer want to type
+db=mysql every time you run your application.
You can add a Default List to your config file. A Defaults List is a list telling Hydra how to compose the final config object. By convention, it is the first item in the config.
Remember to specify the
When you run the updated application, MySQL is loaded by default.
You can have multiple items in the defaults list, e.g.
The defaults are ordered:
- If multiple configs define the same value, the last one wins.
- If multiple configs contribute to the same dictionary, the result is the combined dictionary.
You can still load PostgreSQL, and override individual values.
You can remove a default entry from the defaults list by prefixing it with ~:
Sometimes a config file does not belong in any config group.
You can still load it by default. Here is an example for
Config files that are not part of a config group will always be loaded. They cannot be overridden.
Prefer using a config group.
For more information about the Defaults List see Reference Manual/The Defaults List.