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

Reads and writes tags off of data storage. More...

#include <tag_repository.hpp>

Collaboration diagram for tag_repository:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

std::string sql ()
 Returns the SQL created by sqlgen to construct the table.
 
std::vector< domain::tagread_latest (context ctx, std::uint32_t offset, std::uint32_t limit)
 Reads latest tags with pagination support.
 
std::uint32_t get_total_tag_count (context ctx)
 Gets the total count of active tags.
 
std::vector< domain::tagread_all (context ctx)
 Reads all tags (including historical versions).
 
void remove (context ctx, const std::string &tag_id)
 Deletes a tag by closing its temporal validity.
 
void write (context ctx, const domain::tag &tag)
 Writes a tag to database.
 
void write (context ctx, const std::vector< domain::tag > &tags)
 
std::vector< domain::tagread_latest (context ctx)
 Reads latest tags, possibly filtered by tag_id or name.
 
std::vector< domain::tagread_latest_by_id (context ctx, const std::string &tag_id)
 
std::vector< domain::tagread_latest_by_name (context ctx, const std::string &name)
 

Detailed Description

Reads and writes tags off of data storage.

Member Function Documentation

◆ read_latest()

std::vector< domain::tag > read_latest ( context  ctx,
std::uint32_t  offset,
std::uint32_t  limit 
)

Reads latest tags with pagination support.

Parameters
ctxRepository context with database connection
offsetNumber of records to skip
limitMaximum number of records to return
Returns
Vector of tags within the specified range

◆ get_total_tag_count()

std::uint32_t get_total_tag_count ( context  ctx)

Gets the total count of active tags.

Parameters
ctxRepository context with database connection
Returns
Total number of tags with valid_to == max_timestamp