diff options
author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2025-09-02 16:13:22 +0100 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2025-09-02 16:13:22 +0100 |
commit | ca9be55a98c094e8026a4003a099573dd4137050 (patch) | |
tree | 1d58e13a84fc6bba25242877859027bdfe8f461e /src/ingestor.cpp | |
parent | 07a98c0ba7d2fdd79cab1884f81bb041741fc18c (diff) | |
download | webstat-ca9be55a98c094e8026a4003a099573dd4137050.tar.bz2 webstat-ca9be55a98c094e8026a4003a099573dd4137050.tar.xz webstat-ca9be55a98c094e8026a4003a099573dd4137050.zip |
Store utsname details in the host's detail field
Diffstat (limited to 'src/ingestor.cpp')
-rw-r--r-- | src/ingestor.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ingestor.cpp b/src/ingestor.cpp index ea62d54..87167b5 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -57,13 +57,14 @@ namespace WebStat { } } - Ingestor::Ingestor(const std::string_view hostname, DB::ConnectionPoolPtr dbpl) : - hostnameId {crc32(hostname)}, dbpool {std::move(dbpl)} + Ingestor::Ingestor(const utsname & host, DB::ConnectionPoolPtr dbpl) : + hostnameId {crc32(host.nodename)}, dbpool {std::move(dbpl)} { - storeEntities(dbpool->get().get(), - { - std::make_tuple(hostnameId, EntityType::Host, hostname), - }); + auto dbconn = dbpool->get(); + auto ins = dbconn->modify(SQL::HOST_UPSERT, SQL::HOST_UPSERT_OPTS); + bindMany(ins, 0, hostnameId, host.nodename, host.sysname, host.release, host.version, host.machine, + host.domainname); + ins->execute(); } Ingestor::ScanResult |