Add SQLite profile repository and Qt SQL dependency

This commit is contained in:
Keith Smith
2026-03-01 09:06:31 -07:00
parent 6d147894c5
commit fba7336f69
4 changed files with 203 additions and 2 deletions

35
src/profile_repository.h Normal file
View File

@@ -0,0 +1,35 @@
#ifndef ORBITHUB_PROFILE_REPOSITORY_H
#define ORBITHUB_PROFILE_REPOSITORY_H
#include <QString>
#include <optional>
#include <vector>
struct Profile
{
qint64 id;
QString name;
};
class ProfileRepository
{
public:
ProfileRepository();
~ProfileRepository();
QString initError() const;
std::vector<Profile> listProfiles(const QString& searchQuery = QString()) const;
std::optional<Profile> createProfile(const QString& name) const;
bool updateProfile(qint64 id, const QString& name) const;
bool deleteProfile(qint64 id) const;
private:
QString m_connectionName;
QString m_initError;
bool initializeDatabase();
};
#endif