20#ifndef ORES_CONNECTIONS_REPOSITORY_SQLITE_CONTEXT_HPP
21#define ORES_CONNECTIONS_REPOSITORY_SQLITE_CONTEXT_HPP
24#include <rfl/Result.hpp>
25#include <sqlgen/Ref.hpp>
26#include <sqlgen/sqlite.hpp>
28namespace ores::connections::repository {
38 using connection_type = sqlgen::sqlite::Connection;
39 using connection_ref = sqlgen::Ref<connection_type>;
51 rfl::Result<connection_ref>
connect()
const;
56 const std::filesystem::path&
db_path()
const {
return db_path_; }
72 std::filesystem::path db_path_;
SQLite database context for connection management.
Definition sqlite_context.hpp:36
rfl::Result< connection_ref > connect() const
Get a connection to the SQLite database.
Definition sqlite_context.cpp:29
void initialize_schema()
Initialize the database schema if it doesn't exist.
Definition sqlite_context.cpp:33
void purge_all_data()
Delete all data from all tables.
Definition sqlite_context.cpp:105
const std::filesystem::path & db_path() const
Get the database file path.
Definition sqlite_context.hpp:56