Add SQLite profile repository and Qt SQL dependency
This commit is contained in:
35
src/profile_repository.h
Normal file
35
src/profile_repository.h
Normal 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
|
||||
Reference in New Issue
Block a user