change database, add queries
This commit is contained in:
@@ -7,3 +7,12 @@ SELECT * FROM artists;
|
||||
|
||||
-- name: CreateArtist :one
|
||||
INSERT INTO artists (id, name, genre, bio, artist_image_url) VALUES ($1, $2, $3, $4, $5) RETURNING id;
|
||||
|
||||
-- name: UpdateArtist :exec
|
||||
UPDATE artists SET name = $2, genre = $3, bio = $4, artist_image_url = $5 WHERE id = $1;
|
||||
|
||||
-- name: DeleteArtist :exec
|
||||
DELETE FROM artists WHERE id = $1;
|
||||
|
||||
-- name: SearchArtists :many
|
||||
SELECT * FROM artists WHERE name ILIKE '%' || $1 || '%' OR genre ILIKE '%' || $1 || '%';
|
||||
Reference in New Issue
Block a user