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/sql/hostUpsert.sql | |
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/sql/hostUpsert.sql')
-rw-r--r-- | src/sql/hostUpsert.sql | 7 |
1 files changed, 7 insertions, 0 deletions
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) |