hiling_go/db/sqlc/follow.sql.go
2024-05-22 11:26:15 +07:00

44 lines
975 B
Go
Executable File

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.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.Exec(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.Exec(ctx, removeFollowUser, arg.FollowerID, arg.FolloweeID)
return err
}