Compare commits
No commits in common. "abf09e5f5eb853d44f5a5ea90d63ab3d667072ce" and "f888ac9b70ae3514baa643fbbaa07c70b2de5e99" have entirely different histories.
abf09e5f5e
...
f888ac9b70
2 changed files with 5 additions and 54 deletions
|
|
@ -135,10 +135,10 @@ OFFSET sqlc.narg('offset')::int;
|
||||||
-- WHERE title_id = sqlc.arg('title_id')
|
-- WHERE title_id = sqlc.arg('title_id')
|
||||||
-- RETURNING *;
|
-- RETURNING *;
|
||||||
|
|
||||||
-- name: GetReviewByID :one
|
-- -- name: GetReviewByID :one
|
||||||
SELECT *
|
-- SELECT review_id, user_id, title_id, image_ids, review_text, creation_date
|
||||||
FROM reviews
|
-- FROM reviews
|
||||||
WHERE review_id = sqlc.arg('review_id')::bigint;
|
-- WHERE review_id = $1;
|
||||||
|
|
||||||
-- -- name: CreateReview :one
|
-- -- name: CreateReview :one
|
||||||
-- INSERT INTO reviews (user_id, title_id, image_ids, review_text, creation_date)
|
-- INSERT INTO reviews (user_id, title_id, image_ids, review_text, creation_date)
|
||||||
|
|
@ -157,7 +157,7 @@ WHERE review_id = sqlc.arg('review_id')::bigint;
|
||||||
-- DELETE FROM reviews
|
-- DELETE FROM reviews
|
||||||
-- WHERE review_id = $1;
|
-- WHERE review_id = $1;
|
||||||
|
|
||||||
-- name: ListReviewsByTitle :many
|
-- -- name: ListReviewsByTitle :many
|
||||||
-- SELECT review_id, user_id, title_id, image_ids, review_text, creation_date
|
-- SELECT review_id, user_id, title_id, image_ids, review_text, creation_date
|
||||||
-- FROM reviews
|
-- FROM reviews
|
||||||
-- WHERE title_id = $1
|
-- WHERE title_id = $1
|
||||||
|
|
|
||||||
|
|
@ -41,55 +41,6 @@ func (q *Queries) GetImageByID(ctx context.Context, illustID int64) (Image, erro
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
|
|
||||||
const getReviewByID = `-- name: GetReviewByID :one
|
|
||||||
|
|
||||||
|
|
||||||
SELECT id, data, rating, illust_id, user_id, title_id, created_at
|
|
||||||
FROM reviews
|
|
||||||
WHERE review_id = $1::bigint
|
|
||||||
`
|
|
||||||
|
|
||||||
// -- name: ListTitles :many
|
|
||||||
// SELECT title_id, title_names, studio_id, poster_id, signal_ids,
|
|
||||||
//
|
|
||||||
// title_status, rating, rating_count, release_year, release_season,
|
|
||||||
// season, episodes_aired, episodes_all, episodes_len
|
|
||||||
//
|
|
||||||
// FROM titles
|
|
||||||
// ORDER BY title_id
|
|
||||||
// LIMIT $1 OFFSET $2;
|
|
||||||
// -- name: UpdateTitle :one
|
|
||||||
// UPDATE titles
|
|
||||||
// SET
|
|
||||||
//
|
|
||||||
// title_names = COALESCE(sqlc.narg('title_names'), title_names),
|
|
||||||
// studio_id = COALESCE(sqlc.narg('studio_id'), studio_id),
|
|
||||||
// poster_id = COALESCE(sqlc.narg('poster_id'), poster_id),
|
|
||||||
// signal_ids = COALESCE(sqlc.narg('signal_ids'), signal_ids),
|
|
||||||
// title_status = COALESCE(sqlc.narg('title_status'), title_status),
|
|
||||||
// release_year = COALESCE(sqlc.narg('release_year'), release_year),
|
|
||||||
// release_season = COALESCE(sqlc.narg('release_season'), release_season),
|
|
||||||
// episodes_aired = COALESCE(sqlc.narg('episodes_aired'), episodes_aired),
|
|
||||||
// episodes_all = COALESCE(sqlc.narg('episodes_all'), episodes_all),
|
|
||||||
// episodes_len = COALESCE(sqlc.narg('episodes_len'), episodes_len)
|
|
||||||
//
|
|
||||||
// WHERE title_id = sqlc.arg('title_id')
|
|
||||||
// RETURNING *;
|
|
||||||
func (q *Queries) GetReviewByID(ctx context.Context, reviewID int64) (Review, error) {
|
|
||||||
row := q.db.QueryRow(ctx, getReviewByID, reviewID)
|
|
||||||
var i Review
|
|
||||||
err := row.Scan(
|
|
||||||
&i.ID,
|
|
||||||
&i.Data,
|
|
||||||
&i.Rating,
|
|
||||||
&i.IllustID,
|
|
||||||
&i.UserID,
|
|
||||||
&i.TitleID,
|
|
||||||
&i.CreatedAt,
|
|
||||||
)
|
|
||||||
return i, err
|
|
||||||
}
|
|
||||||
|
|
||||||
const getStudioByID = `-- name: GetStudioByID :one
|
const getStudioByID = `-- name: GetStudioByID :one
|
||||||
SELECT id, studio_name, illust_id, studio_desc
|
SELECT id, studio_name, illust_id, studio_desc
|
||||||
FROM studios
|
FROM studios
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue