#pragma once #include #include #include struct sqlite3; namespace pex { struct Host { int64_t id = 0; std::string name; std::string url; std::string token; std::string os; // "linux" | "windows" | "wsl" int64_t last_seen_unix = 0; bool is_local = false; }; class HostsDb { public: HostsDb(); ~HostsDb(); // path debe ser absoluto (fn::local_path("hosts.db")). bool open(const std::string& path); void close(); std::vector list(); int64_t upsert(const Host& h); // devuelve id; -1 si falla bool remove(int64_t id); bool touch_last_seen(int64_t id, int64_t unix_ts); private: sqlite3* db_ = nullptr; }; } // namespace pex