Skip to content

Commit 67ee610

Browse files
committed
remove unused queries
1 parent f64b7bb commit 67ee610

File tree

8 files changed

+0
-125
lines changed

8 files changed

+0
-125
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -685,15 +685,6 @@ func (q *querier) DeleteCoordinator(ctx context.Context, id uuid.UUID) error {
685685
return q.db.DeleteCoordinator(ctx, id)
686686
}
687687

688-
func (q *querier) DeleteGitAuthLink(ctx context.Context, arg database.DeleteGitAuthLinkParams) error {
689-
return deleteQ(q.log, q.auth, func(ctx context.Context, arg database.DeleteGitAuthLinkParams) (database.GitAuthLink, error) {
690-
return q.db.GetGitAuthLink(ctx, database.GetGitAuthLinkParams{
691-
UserID: arg.UserID,
692-
ProviderID: arg.ProviderID,
693-
})
694-
}, q.db.DeleteGitAuthLink)(ctx, arg)
695-
}
696-
697688
func (q *querier) DeleteGitSSHKey(ctx context.Context, userID uuid.UUID) error {
698689
return deleteQ(q.log, q.auth, q.db.GetGitSSHKey, q.db.DeleteGitSSHKey)(ctx, userID)
699690
}
@@ -766,10 +757,6 @@ func (q *querier) DeleteTailnetClient(ctx context.Context, arg database.DeleteTa
766757
return q.db.DeleteTailnetClient(ctx, arg)
767758
}
768759

769-
func (q *querier) DeleteUserLinkByLinkedID(ctx context.Context, linkedID string) error {
770-
return deleteQ(q.log, q.auth, q.db.GetUserLinkByLinkedID, q.db.DeleteUserLinkByLinkedID)(ctx, linkedID)
771-
}
772-
773760
func (q *querier) GetAPIKeyByID(ctx context.Context, id string) (database.APIKey, error) {
774761
return fetch(q.log, q.auth, q.db.GetAPIKeyByID)(ctx, id)
775762
}

coderd/database/dbfake/dbfake.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -774,24 +774,6 @@ func (*FakeQuerier) DeleteCoordinator(context.Context, uuid.UUID) error {
774774
return ErrUnimplemented
775775
}
776776

777-
func (q *FakeQuerier) DeleteGitAuthLink(_ context.Context, arg database.DeleteGitAuthLinkParams) error {
778-
q.mutex.Lock()
779-
defer q.mutex.Unlock()
780-
781-
for index, link := range q.gitAuthLinks {
782-
if link.ProviderID != arg.ProviderID {
783-
continue
784-
}
785-
if link.UserID != arg.UserID {
786-
continue
787-
}
788-
q.gitAuthLinks[index] = q.gitAuthLinks[len(q.gitAuthLinks)-1]
789-
q.gitAuthLinks = q.gitAuthLinks[:len(q.gitAuthLinks)-1]
790-
return nil
791-
}
792-
return sql.ErrNoRows
793-
}
794-
795777
func (q *FakeQuerier) DeleteGitSSHKey(_ context.Context, userID uuid.UUID) error {
796778
q.mutex.Lock()
797779
defer q.mutex.Unlock()
@@ -908,21 +890,6 @@ func (*FakeQuerier) DeleteTailnetClient(context.Context, database.DeleteTailnetC
908890
return database.DeleteTailnetClientRow{}, ErrUnimplemented
909891
}
910892

911-
func (q *FakeQuerier) DeleteUserLinkByLinkedID(_ context.Context, linkedID string) error {
912-
q.mutex.Lock()
913-
defer q.mutex.Unlock()
914-
915-
for index, link := range q.userLinks {
916-
if link.LinkedID != linkedID {
917-
continue
918-
}
919-
q.userLinks[index] = q.userLinks[len(q.userLinks)-1]
920-
q.userLinks = q.userLinks[:len(q.userLinks)-1]
921-
return nil
922-
}
923-
return sql.ErrNoRows
924-
}
925-
926893
func (q *FakeQuerier) GetAPIKeyByID(_ context.Context, id string) (database.APIKey, error) {
927894
q.mutex.RLock()
928895
defer q.mutex.RUnlock()

coderd/database/dbmetrics/dbmetrics.go

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbmock/dbmock.go

Lines changed: 0 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/querier.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 0 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/gitauth.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ UPDATE git_auth_links SET
3131
oauth_refresh_token = $5,
3232
oauth_expiry = $6
3333
WHERE provider_id = $1 AND user_id = $2 RETURNING *;
34-
35-
-- name: DeleteGitAuthLink :exec
36-
DELETE FROM git_auth_links WHERE provider_id = $1 AND user_id = $2;

coderd/database/queries/user_links.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,3 @@ SET
4747
oauth_expiry = $3
4848
WHERE
4949
user_id = $4 AND login_type = $5 RETURNING *;
50-
51-
-- name: DeleteUserLinkByLinkedID :exec
52-
DELETE FROM
53-
user_links
54-
WHERE
55-
linked_id = $1;

0 commit comments

Comments
 (0)