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

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

#include <image_repository.hpp>

Collaboration diagram for image_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::imageread_latest (context ctx, std::uint32_t offset, std::uint32_t limit)
 Reads latest images with pagination support.
 
std::vector< domain::imageread_latest_since (context ctx, std::chrono::system_clock::time_point modified_since)
 Reads latest images modified since a given timestamp.
 
std::uint32_t get_total_image_count (context ctx)
 Gets the total count of active images.
 
std::vector< domain::imageread_all (context ctx)
 Reads all images (including historical versions).
 
void remove (context ctx, const std::string &image_id)
 Deletes an image by closing its temporal validity.
 
void write (context ctx, const domain::image &image)
 Writes an image to database.
 
void write (context ctx, const std::vector< domain::image > &images)
 
std::vector< domain::imageread_latest (context ctx)
 Reads latest images, possibly filtered by image_id or key.
 
std::vector< domain::imageread_latest_by_id (context ctx, const std::string &image_id)
 
std::vector< domain::imageread_latest_by_ids (context ctx, const std::vector< std::string > &image_ids)
 
std::vector< domain::imageread_latest_by_key (context ctx, const std::string &key)
 

Detailed Description

Reads and writes images off of data storage.

Member Function Documentation

◆ read_latest()

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

Reads latest images with pagination support.

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

◆ read_latest_since()

std::vector< domain::image > read_latest_since ( context  ctx,
std::chrono::system_clock::time_point  modified_since 
)

Reads latest images modified since a given timestamp.

Parameters
ctxRepository context with database connection
modified_sinceOnly return images with recorded_at >= this time
Returns
Vector of images modified since the given timestamp

◆ get_total_image_count()

std::uint32_t get_total_image_count ( context  ctx)

Gets the total count of active images.

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