forked from janhq/cortex.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile.h
More file actions
31 lines (22 loc) · 730 Bytes
/
file.h
File metadata and controls
31 lines (22 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <SQLiteCpp/Database.h>
#include <trantor/utils/Logger.h>
#include <string>
#include <vector>
#include "common/file.h"
#include "database.h"
#include "utils/result.hpp"
namespace cortex::db {
class File {
SQLite::Database& db_;
public:
File(SQLite::Database& db) : db_{db} {};
File() : db_(cortex::db::Database::GetInstance().db()) {}
~File() {}
cpp::result<std::vector<OpenAi::File>, std::string> GetFileList() const;
cpp::result<OpenAi::File, std::string> GetFileById(
const std::string& file_id) const;
cpp::result<void, std::string> AddFileEntry(OpenAi::File& file);
cpp::result<void, std::string> DeleteFileEntry(const std::string& file_id);
};
} // namespace cortex::db