|
ORE Studio 0.0.4
|
Reads and writes tenants to data storage. More...
#include <tenant_repository.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| tenant_repository (context ctx) | |
| std::string | sql () |
| Returns the SQL created by sqlgen to construct the table. | |
| std::vector< domain::tenant > | read_latest () |
| Reads all latest active tenants. | |
| std::vector< domain::tenant > | read_all_latest () |
| Reads the latest version of all tenants including deleted. | |
| std::vector< domain::tenant > | read_latest (const boost::uuids::uuid &id) |
| Reads a specific tenant by ID. | |
| std::vector< domain::tenant > | read_latest_by_code (const std::string &code) |
| Reads a specific tenant by code. | |
| std::vector< domain::tenant > | read_latest_by_hostname (const std::string &hostname) |
| Reads a specific tenant by hostname. | |
| std::vector< domain::tenant > | read_history (const boost::uuids::uuid &id) |
| Reads all historical versions of a tenant. | |
| void | remove (const boost::uuids::uuid &tenant_id) |
| Deletes a tenant by closing its temporal validity. | |
| void | write (const domain::tenant &tenant) |
| Writes a tenant to database. | |
| void | write (const std::vector< domain::tenant > &tenants) |
Reads and writes tenants to data storage.
| std::vector< domain::tenant > read_latest | ( | ) |
Reads all latest active tenants.
Returns only tenants where valid_to = infinity (not deleted).
| std::vector< domain::tenant > read_all_latest | ( | ) |
Reads the latest version of all tenants including deleted.
Returns the most recent version of each tenant, regardless of whether it has been soft-deleted (valid_to != infinity).