You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/dao/slonik/sqlc/postgres/query_pgc/comments.sql

17 lines
723 B

--------------------------------------------------------------------------------
-- comment sql dml
--------------------------------------------------------------------------------
-- name: GetNewestComments :many
SELECT * FROM p_comment WHERE post_id=$1 AND is_del=0 ORDER BY id DESC LIMIT $2 OFFSET $3;
-- name: GetDefaultComments :many
SELECT * FROM p_comment WHERE post_id=$1 AND is_del=0 ORDER BY id ASC LIMIT $2 OFFSET $3;
--------------------------------------------------------------------------------
-- comment_manage sql dml
--------------------------------------------------------------------------------
-- name: DeleteComment :exec
UPDATE p_comment SET deleted_on=$1, is_del=1 WHERE id=$2 AND is_del=0;