sql updates
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-13 09:25:12 +10:00
parent 3f2a67cf7b
commit f0278388cb
6 changed files with 209 additions and 26 deletions

View File

@@ -2,9 +2,17 @@
SELECT * FROM "Inventory"
ORDER BY "Name";
-- name: GetInventoryByName :one
-- name: GetInventoryByName :many
SELECT * FROM "Inventory"
WHERE "Name" = ? LIMIT 1;
WHERE "Name" = ?;
-- name: GetInventoryVmId :one
SELECT * FROM "Inventory"
WHERE "VmId" = ? LIMIT 1;
-- name: GetInventoryEventId :one
SELECT * FROM "Inventory"
WHERE "EventId" = ? LIMIT 1;
-- name: CreateInventory :one
INSERT INTO "Inventory" (
@@ -12,4 +20,12 @@ INSERT INTO "Inventory" (
) VALUES(
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
RETURNING *;
-- name: CreateUpdate :one
INSERT INTO "Updates" (
"InventoryId", "EventKey", "EventId", "UpdateTime", "UpdateType", "NewVcpus", "NewRam", "NewResourcePool"
) VALUES(
?, ?, ?, ?, ?, ?, ?, ?
)
RETURNING *;