Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added catalog CRUD queries #18

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions server/queries/catalog.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- GET - Returns all data from the catalog table
SELECT * FROM catalog;


-- GET/:id - Returns the row that matches the id
SELECT * FROM catalog WHERE id = ?;


-- POST - Adds a new row to the catalog table
INSERT INTO catalog (id, host, title, event_type, subject, description, year)
VALUES (?, ?, ?, ?, ?, ?, ?);


-- PUT - Updates an existing row given an id
-- All fields are optional
UPDATE catalog
SET host = ?, title = ?, event_type = ?, subject = ?, description = ?, year = ?
WHERE id = ?;


-- DELETE - deletes an existing row given an id
DELETE FROM catalog WHERE id=?;
Loading