|
ORE Studio 0.0.4
|
Reads and writes countries off of data storage. More...
#include <country_repository.hpp>

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::country > | read_latest (context ctx, std::uint32_t offset, std::uint32_t limit) |
| Reads latest countries with pagination support. | |
| std::uint32_t | get_total_country_count (context ctx) |
| Gets the total count of active countries. | |
| void | remove (context ctx, const std::string &alpha2_code) |
| Deletes a country by closing its temporal validity. | |
| void | write (context ctx, const domain::country &country) |
| Writes countries to database. Expects the country set to have unique alpha-2 codes. | |
| void | write (context ctx, const std::vector< domain::country > &countries) |
| std::vector< domain::country > | read_latest (context ctx) |
| Reads latest countries, possibly filtered by alpha-2 code. | |
| std::vector< domain::country > | read_latest (context ctx, const std::string &alpha2_code) |
| std::vector< domain::country > | read_at_timepoint (context ctx, const std::string &as_of) |
| Reads countries at the supplied time point, possibly filtered by alpha-2 code. | |
| std::vector< domain::country > | read_at_timepoint (context ctx, const std::string &as_of, const std::string &alpha2_code) |
| std::vector< domain::country > | read_all (context ctx) |
| Reads all countries, possibly filtered by alpha-2 code. | |
| std::vector< domain::country > | read_all (context ctx, const std::string &alpha2_code) |
Reads and writes countries off of data storage.
| std::vector< domain::country > read_latest | ( | context | ctx, |
| std::uint32_t | offset, | ||
| std::uint32_t | limit | ||
| ) |
Reads latest countries with pagination support.
| ctx | Repository context with database connection |
| offset | Number of records to skip |
| limit | Maximum number of records to return |
| std::uint32_t get_total_country_count | ( | context | ctx | ) |
Gets the total count of active countries.
| ctx | Repository context with database connection |

| void remove | ( | context | ctx, |
| const std::string & | alpha2_code | ||
| ) |
Deletes a country by closing its temporal validity.
Sets the valid_to timestamp to now, effectively "deleting" the country from the current point in time onwards while preserving history.
