#ifndef ORBITHUB_PROFILE_REPOSITORY_H #define ORBITHUB_PROFILE_REPOSITORY_H #include #include #include #include struct Profile { qint64 id = -1; QString name; QString host; int port = 22; QString username; QString protocol = QStringLiteral("SSH"); QString authMode = QStringLiteral("Password"); QString privateKeyPath; QString knownHostsPolicy = QStringLiteral("Ask"); }; class ProfileRepository { public: ProfileRepository(); ~ProfileRepository(); QString initError() const; QString lastError() const; std::vector listProfiles(const QString& searchQuery = QString()) const; std::optional getProfile(qint64 id) const; std::optional createProfile(const Profile& profile) const; bool updateProfile(const Profile& profile) const; bool deleteProfile(qint64 id) const; private: QString m_connectionName; QString m_initError; mutable QString m_lastError; bool initializeDatabase(); bool ensureProfileSchema() const; void setLastError(const QString& error) const; }; #endif