Mostly Initial Setup And Testing Stuff

This commit is contained in:
Annika Merris 2024-01-26 17:11:42 -05:00
parent 8c147b23d8
commit d52d9968ba
12 changed files with 502 additions and 0 deletions

89
sql/powerItem/query.sql Normal file
View file

@ -0,0 +1,89 @@
-- GetAllItems finds all items.
-- name: GetAllItems :many
SELECT
id,
itemType,
iconURL,
itemName,
minItemPower,
maxItemPower,
rarity,
origin,
tooltip,
isEventItem
FROM
powerItem;
-- FindByID finds items by the ID
-- name: FindByID :one
SELECT
id,
itemType,
iconURL,
itemName,
minItemPower,
maxItemPower,
rarity,
origin,
tooltip,
isEventItem
FROM
powerItem
WHERE
id = pggen.arg('id');
-- AddNewItem inserts a new power item
-- name: AddNewItem :one
INSERT INTO
powerItem (
itemType,
iconURL,
itemName,
minItemPower,
maxItemPower,
rarity,
origin,
tooltip,
isEventItem
)
VALUES
(
pggen.arg('itemType'),
pggen.arg('iconUrl'),
pggen.arg('itemName'),
pggen.arg('minItemPower'),
pggen.arg('maxItemPower'),
pggen.arg('rarity'),
pggen.arg('origin'),
pggen.arg('tooltip'),
pggen.arg('isEventItem')
) RETURNING *;
-- AddNewItemWithID inserts a new power item
-- name: AddNewItemWithID :one
INSERT INTO
powerItem (
id,
itemType,
iconURL,
itemName,
minItemPower,
maxItemPower,
rarity,
origin,
tooltip,
isEventItem
)
VALUES
(
pggen.arg('id'),
pggen.arg('itemType'),
pggen.arg('iconUrl'),
pggen.arg('itemName'),
pggen.arg('minItemPower'),
pggen.arg('maxItemPower'),
pggen.arg('rarity'),
pggen.arg('origin'),
pggen.arg('tooltip'),
pggen.arg('isEventItem')
) RETURNING *;

12
sql/powerItem/schema.sql Normal file
View file

@ -0,0 +1,12 @@
CREATE TABLE powerItem (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
itemType int NOT NULL,
iconURL text NOT NULL,
itemName text NOT NULL,
minItemPower integer NOT NULL,
maxItemPower integer NOT NULL,
rarity int NOT NULL,
origin text NOT NULL,
tooltip text NULL,
isEventItem boolean
)