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

Reads and writes feature flags from data storage. More...

#include <feature_flags_repository.hpp>

Collaboration diagram for feature_flags_repository:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

 feature_flags_repository (context ctx)
 
std::string sql ()
 Returns the SQL created by sqlgen to construct the table.
 
std::vector< domain::feature_flagsread_latest (std::uint32_t offset, std::uint32_t limit)
 Reads latest feature flags with pagination support.
 
std::uint32_t get_total_feature_flags_count ()
 Gets the total count of active feature flags.
 
void remove (const std::string &name)
 Deletes a feature flag by closing its temporal validity.
 
void write (const domain::feature_flags &flag)
 Writes feature flags to database. Expects the feature flag set to have unique names.
 
void write (const std::vector< domain::feature_flags > &flags)
 
std::vector< domain::feature_flagsread_latest ()
 Reads latest feature flags, possibly filtered by name.
 
std::vector< domain::feature_flagsread_latest (const std::string &name)
 
std::vector< domain::feature_flagsread_all ()
 Reads all feature flags, possibly filtered by name.
 
std::vector< domain::feature_flagsread_all (const std::string &name)
 

Detailed Description

Reads and writes feature flags from data storage.

Member Function Documentation

◆ read_latest()

std::vector< domain::feature_flags > read_latest ( std::uint32_t  offset,
std::uint32_t  limit 
)

Reads latest feature flags with pagination support.

Parameters
offsetNumber of records to skip
limitMaximum number of records to return
Returns
Vector of feature flags within the specified range

◆ get_total_feature_flags_count()

std::uint32_t get_total_feature_flags_count ( )

Gets the total count of active feature flags.

Returns
Total number of feature flags with valid_to == max_timestamp

◆ remove()

void remove ( const std::string &  name)

Deletes a feature flag by closing its temporal validity.

Sets the valid_to timestamp to now, effectively "deleting" the feature flag from the current point in time onwards while preserving history.

Here is the caller graph for this function: