db: add DeleteUser
This commit is contained in:
@@ -16,6 +16,7 @@ type Querier interface {
|
|||||||
DeleteContinueWatchingEntry(ctx context.Context, arg DeleteContinueWatchingEntryParams) error
|
DeleteContinueWatchingEntry(ctx context.Context, arg DeleteContinueWatchingEntryParams) error
|
||||||
DeleteExpiredJikanCache(ctx context.Context) error
|
DeleteExpiredJikanCache(ctx context.Context) error
|
||||||
DeleteSession(ctx context.Context, id string) error
|
DeleteSession(ctx context.Context, id string) error
|
||||||
|
DeleteUser(ctx context.Context, id string) error
|
||||||
DeleteUserSessions(ctx context.Context, userID string) error
|
DeleteUserSessions(ctx context.Context, userID string) error
|
||||||
DeleteWatchListEntry(ctx context.Context, arg DeleteWatchListEntryParams) error
|
DeleteWatchListEntry(ctx context.Context, arg DeleteWatchListEntryParams) error
|
||||||
EnqueueAnimeFetchRetry(ctx context.Context, arg EnqueueAnimeFetchRetryParams) error
|
EnqueueAnimeFetchRetry(ctx context.Context, arg EnqueueAnimeFetchRetryParams) error
|
||||||
|
|||||||
@@ -115,6 +115,15 @@ func (q *Queries) DeleteSession(ctx context.Context, id string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deleteUser = `-- name: DeleteUser :exec
|
||||||
|
DELETE FROM user WHERE id = ?
|
||||||
|
`
|
||||||
|
|
||||||
|
func (q *Queries) DeleteUser(ctx context.Context, id string) error {
|
||||||
|
_, err := q.db.ExecContext(ctx, deleteUser, id)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
const deleteUserSessions = `-- name: DeleteUserSessions :exec
|
const deleteUserSessions = `-- name: DeleteUserSessions :exec
|
||||||
DELETE FROM session WHERE user_id = ?
|
DELETE FROM session WHERE user_id = ?
|
||||||
`
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user