ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
system_flags_seeder Class Reference

Seeds system flags in the database at startup. More...

#include <system_flags_seeder.hpp>

Collaboration diagram for system_flags_seeder:
Collaboration graph

Public Member Functions

 system_flags_seeder (database::context ctx)
 Constructs a system_flags_seeder.
 
std::size_t seed ()
 Seeds all system flags into the database.
 

Detailed Description

Seeds system flags in the database at startup.

The system_flags_seeder ensures that all well-known system flags exist in the database with their default values. This should be called early during service startup, before any component queries system flags.

The seeder only creates flags that don't already exist - it does not overwrite existing flag values, preserving any user modifications.

This is idempotent - running it multiple times will not create duplicate entries.

Constructor & Destructor Documentation

◆ system_flags_seeder()

Constructs a system_flags_seeder.

Parameters
ctxThe database context to be used by the underlying repository.

Member Function Documentation

◆ seed()

std::size_t seed ( )

Seeds all system flags into the database.

Iterates through the compile-time manifest of system flags and creates any flags that don't already exist in the database. Existing flags are left unchanged.

Returns
The number of flags that were created (0 if all already existed).