2023-10-03 16:14:58 +07:00
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
|
|
// versions:
|
2024-08-19 07:40:01 +07:00
|
|
|
// sqlc v1.26.0
|
2023-10-03 16:14:58 +07:00
|
|
|
// 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 {
|
2024-02-06 11:55:25 +07:00
|
|
|
_, err := q.db.Exec(ctx, addFollowUser, arg.FollowerID, arg.FolloweeID)
|
2023-10-03 16:14:58 +07:00
|
|
|
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 {
|
2024-02-06 11:55:25 +07:00
|
|
|
_, err := q.db.Exec(ctx, removeFollowUser, arg.FollowerID, arg.FolloweeID)
|
2023-10-03 16:14:58 +07:00
|
|
|
return err
|
|
|
|
}
|