20#ifndef ORES_DQ_REPOSITORY_CODING_SCHEME_REPOSITORY_HPP
21#define ORES_DQ_REPOSITORY_CODING_SCHEME_REPOSITORY_HPP
25#include <sqlgen/postgres.hpp>
26#include "ores.logging/make_logger.hpp"
27#include "ores.database/domain/context.hpp"
28#include "ores.dq/domain/coding_scheme.hpp"
30namespace ores::dq::repository {
37 inline static std::string_view logger_name =
38 "ores.dq.repository.coding_scheme_repository";
40 [[nodiscard]]
static auto& lg() {
42 static auto instance = make_logger(logger_name);
54 void write(
const std::vector<domain::coding_scheme>& schemes);
56 std::vector<domain::coding_scheme> read_latest();
57 std::vector<domain::coding_scheme> read_latest(
const std::string& code);
58 std::vector<domain::coding_scheme>
59 read_latest(std::uint32_t offset, std::uint32_t limit);
64 std::vector<domain::coding_scheme>
70 std::vector<domain::coding_scheme>
72 const std::string& domain_name);
74 std::uint32_t get_total_count();
75 std::vector<domain::coding_scheme> read_all(
const std::string& code);
76 void remove(
const std::string& code);
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:30
Defines a coding or identification standard used to identify entities.
Definition coding_scheme.hpp:36
Reads and writes coding_schemes to data storage.
Definition coding_scheme_repository.hpp:35
std::vector< domain::coding_scheme > read_latest_by_subject_area(const std::string &subject_area_name, const std::string &domain_name)
Reads latest coding_schemes by subject area.
Definition coding_scheme_repository.cpp:120
std::vector< domain::coding_scheme > read_latest_by_authority_type(const std::string &authority_type)
Reads latest coding_schemes by authority type.
Definition coding_scheme_repository.cpp:104