From ca9be55a98c094e8026a4003a099573dd4137050 Mon Sep 17 00:00:00 2001
From: Dan Goodliffe <dan.goodliffe@octal.co.uk>
Date: Tue, 2 Sep 2025 16:13:22 +0100
Subject: Store utsname details in the host's detail field

---
 src/sql/hostUpsert.sql | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 src/sql/hostUpsert.sql

(limited to 'src/sql/hostUpsert.sql')

diff --git a/src/sql/hostUpsert.sql b/src/sql/hostUpsert.sql
new file mode 100644
index 0000000..2b1109c
--- /dev/null
+++ b/src/sql/hostUpsert.sql
@@ -0,0 +1,7 @@
+INSERT INTO entities (id, type, value, detail)
+	VALUES ($1, 'host', $2, jsonb_build_object('sysname', $3::text, 'release',
+	$4::text, 'version', $5::text, 'machine', $6::text, 'domainname', $7::text))
+ON CONFLICT ON CONSTRAINT pk_entities
+	DO UPDATE SET
+		detail = jsonb_build_object('sysname', $3::text, 'release',
+		$4::text, 'version', $5::text, 'machine', $6::text, 'domainname', $7::text)
-- 
cgit v1.2.3

