hiling_go/db/sqlc/follow.sql.go

44 lines
989 B
Go
Raw Normal View History

2023-10-03 16:14:58 +07:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.20.0
// source: follow.sql
package db
import (
"context"
)
const addFollowUser = `-- name: AddFollowUser :exec
INSERT INTO user_follow (
follower_id,
followee_id
) VALUES($1, $2)
`
type AddFollowUserParams struct {
FollowerID int32 `json:"follower_id"`
FolloweeID int32 `json:"followee_id"`
}
func (q *Queries) AddFollowUser(ctx context.Context, arg AddFollowUserParams) error {
_, err := q.db.ExecContext(ctx, addFollowUser, arg.FollowerID, arg.FolloweeID)
return err
}
const removeFollowUser = `-- name: RemoveFollowUser :exec
DELETE FROM
user_follow
WHERE follower_id = $1 AND followee_id = $2
`
type RemoveFollowUserParams struct {
FollowerID int32 `json:"follower_id"`
FolloweeID int32 `json:"followee_id"`
}
func (q *Queries) RemoveFollowUser(ctx context.Context, arg RemoveFollowUserParams) error {
_, err := q.db.ExecContext(ctx, removeFollowUser, arg.FollowerID, arg.FolloweeID)
return err
}