sql updates
This commit is contained in:
@@ -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 *;
|
Reference in New Issue
Block a user