From 12617b6aaf5d13238505e96f938845ffa2b2106e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 30 Jan 2025 07:57:47 -0500 Subject: [PATCH] database: Remove unused ListAllOperationDocs method --- internal/database/database.go | 6 ------ internal/mocks/dbclient.go | 14 -------------- 2 files changed, 20 deletions(-) diff --git a/internal/database/database.go b/internal/database/database.go index f92f5668e3..c6d76f0bac 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -80,7 +80,6 @@ type DBClient interface { CreateOperationDoc(ctx context.Context, doc *OperationDocument) error UpdateOperationDoc(ctx context.Context, operationID string, callback func(*OperationDocument) bool) (bool, error) ListOperationDocs(subscriptionID string) DBClientIterator[OperationDocument] - ListAllOperationDocs() DBClientIterator[OperationDocument] // GetSubscriptionDoc retrieves a SubscriptionDocument from the database given the subscriptionID. // ErrNotFound is returned if an associated SubscriptionDocument cannot be found. @@ -422,11 +421,6 @@ func (d *CosmosDBClient) ListOperationDocs(subscriptionID string) DBClientIterat return newQueryItemsIterator[OperationDocument](pager) } -func (d *CosmosDBClient) ListAllOperationDocs() DBClientIterator[OperationDocument] { - pk := azcosmos.NewPartitionKeyString(operationsPartitionKey) - return newQueryItemsIterator[OperationDocument](d.operations.NewQueryItemsPager("SELECT * FROM c", pk, nil)) -} - // GetSubscriptionDoc retreives a subscription document from async DB using the subscription ID func (d *CosmosDBClient) GetSubscriptionDoc(ctx context.Context, subscriptionID string) (*SubscriptionDocument, error) { // Make sure lookup keys are lowercase. diff --git a/internal/mocks/dbclient.go b/internal/mocks/dbclient.go index 106a705f4c..728da05c6a 100644 --- a/internal/mocks/dbclient.go +++ b/internal/mocks/dbclient.go @@ -237,20 +237,6 @@ func (mr *MockDBClientMockRecorder) GetSubscriptionDoc(ctx, subscriptionID any) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubscriptionDoc", reflect.TypeOf((*MockDBClient)(nil).GetSubscriptionDoc), ctx, subscriptionID) } -// ListAllOperationDocs mocks base method. -func (m *MockDBClient) ListAllOperationDocs() database.DBClientIterator[database.OperationDocument] { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListAllOperationDocs") - ret0, _ := ret[0].(database.DBClientIterator[database.OperationDocument]) - return ret0 -} - -// ListAllOperationDocs indicates an expected call of ListAllOperationDocs. -func (mr *MockDBClientMockRecorder) ListAllOperationDocs() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllOperationDocs", reflect.TypeOf((*MockDBClient)(nil).ListAllOperationDocs)) -} - // ListAllSubscriptionDocs mocks base method. func (m *MockDBClient) ListAllSubscriptionDocs() database.DBClientIterator[database.SubscriptionDocument] { m.ctrl.T.Helper()