Files
mtusi2026lab2/src/message_repo.hpp
T
AndrewNikkk 50b30b4b47
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab2
2026-10-16 05:27:13 +03:00

25 lines
564 B
C++

#pragma once
#include "db.hpp"
#include "models.hpp"
#include <optional>
#include <string>
#include <vector>
class MessageRepo {
public:
explicit MessageRepo(PgPool& pool) : pool_(pool) {}
std::optional<Message> create(const std::string& chat_id,
const std::string& sender_id,
const std::string& text);
std::optional<MessagePage> list_page(
const std::string& chat_id,
int limit,
const std::optional<std::string>& cursor);
private:
PgPool& pool_;
};