Skip to content

Commit

Permalink
more sql things
Browse files Browse the repository at this point in the history
  • Loading branch information
onlypuppy7 committed Dec 15, 2024
1 parent 0d0801c commit 2ec4fbd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions server-client/src/client-static/sql/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,23 @@ <h1>LegacyShell SQL Request Tool</h1>
{ name: "[codes] Get Code by Key", code: "SELECT * FROM codes WHERE key = ?;" },
{ name: "[codes] Create New Code with Default Key", code: `
INSERT INTO codes (item_ids, eggs_given, uses)
VALUES (?, ?, ?)
VALUES (?, ?, 1)
RETURNING *;
`},
{ name: "[codes] Create New Code with Custom Key", code: `
INSERT INTO codes (key, item_ids, eggs_given, uses)
VALUES (?, ?, ?, ?)
VALUES (?, ?, ?, 1)
RETURNING *;
`},
{ name: "[codes] Create Multiple Codes", code: `
WITH RECURSIVE count(n) AS (
SELECT 1
UNION ALL
SELECT n + 1 FROM count WHERE n < 3
)
INSERT INTO codes (item_ids, eggs_given, uses)
SELECT ?, ?, 1 FROM count
RETURNING key;
`},
{ name: "[codes] Update Code Usage", code: `
UPDATE codes
Expand Down

0 comments on commit 2ec4fbd

Please sign in to comment.