Skip to main content
Version: Next

Config Store API

ConfigStore is a singleton storing configs in memory. The primary API for interacting with the ConfigStore is the store method described below.


class ConfigStore(metaclass=Singleton):    def store(        self,        name: str,        node: Any,        group: Optional[str] = None,        package: Optional[str] = "_group_",        provider: Optional[str] = None,    ) -> None:        """        Stores a config node into the repository        :param name: config name        :param node: config node, can be DictConfig, ListConfig,            Structured configs and even dict and list        :param group: config group, subgroup separator is '/',            for example hydra/launcher        :param package: Config node parent hierarchy.            Child separator is '.', for example        :param provider: the name of the module/app providing this config.            Helps debugging.        """    ...

Example node values#

A few examples of supported node values parameters:

@dataclassclass MySQLConfig:    host: str = "localhost"    port: int = 3306
# Using the"config1", node=MySQLConfig)# Using an instance, overriding some default"config2", node=MySQLConfig(host="test.db", port=3307))# Using a dictionary, forfeiting runtime type"config3", node={"host": "localhost", "port": 3308})