summaryrefslogtreecommitdiff
path: root/src/sql/hostUpsert.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/hostUpsert.sql')
-rw-r--r--src/sql/hostUpsert.sql7
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)