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

Reads and writes catalogs to data storage. More...

#include <catalog_repository.hpp>

Collaboration diagram for catalog_repository:
Collaboration graph

Public Types

using context = ores::database::context
 

Public Member Functions

 catalog_repository (context ctx)
 
std::string sql ()
 Returns the SQL created by sqlgen to construct the table.
 
std::vector< domain::catalogread_latest (std::uint32_t offset, std::uint32_t limit)
 Reads latest catalogs with pagination support.
 
std::uint32_t get_total_count ()
 Gets the total count of active catalogs.
 
std::vector< domain::catalogread_all (const std::string &name)
 Reads all historical versions of a catalog by name.
 
void remove (const std::string &name)
 Deletes a catalog by closing its temporal validity.
 
void write (const domain::catalog &catalog)
 Writes catalogs to database.
 
void write (const std::vector< domain::catalog > &catalogs)
 
std::vector< domain::catalogread_latest ()
 Reads latest catalogs, possibly filtered by name.
 
std::vector< domain::catalogread_latest (const std::string &name)
 

Detailed Description

Reads and writes catalogs to data storage.

Member Function Documentation

◆ read_latest()

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

Reads latest catalogs with pagination support.

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

◆ get_total_count()

std::uint32_t get_total_count ( )

Gets the total count of active catalogs.

Returns
Total number of catalogs with valid_to == max_timestamp
Here is the caller graph for this function:

◆ read_all()

std::vector< domain::catalog > read_all ( const std::string &  name)

Reads all historical versions of a catalog by name.

Parameters
nameThe catalog name to look up
Returns
Vector of all versions, ordered by version descending
Here is the caller graph for this function: