hiling_go/db/sqlc/follow.sql.go

44 lines
975 B
Go
Raw Normal View History

2023-10-03 16:14:58 +07:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
2024-02-06 11:55:25 +07:00
// sqlc v1.25.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
}