diff --git a/lib/util/find/FindBuilder.ts b/lib/util/find/FindBuilder.ts index 5f6c239..1c87eaa 100644 --- a/lib/util/find/FindBuilder.ts +++ b/lib/util/find/FindBuilder.ts @@ -179,32 +179,6 @@ class FindBuilder extends BaseFind { return selectBuilder; } - /** - * Limits the result set with an optional offset. - * - * @deprecated Use `this.builder().find().paginate` instead of `this.builder().find().limit`. - * @param options - The options for limiting the result set. - * @param options.limit - The limit for the result set. - * @param options.skip - Optional. The number of items to skip in the result set. - * @returns FindBuilder instance - * - * @example - * const results = await this.builder().find({ - * name: 'A company name', - * }) - * .limit({ limit: 10, skip: 5 }) - * .execute(); - */ - public limit(options: { limit: number; skip?: number }): this { - if (options.skip !== null) { - void this.select.limit(options.limit, options.skip); - return this; - } - - void this.select.limit(options.limit); - return this; - } - /** * Limits the result set with an optional offset. * diff --git a/package-lock.json b/package-lock.json index 4c9cdaf..1b7bd48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dxfrontier/cds-ts-repository", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dxfrontier/cds-ts-repository", - "version": "2.0.4", + "version": "2.0.5", "license": "MIT", "workspaces": [ "./test/bookshop" diff --git a/package.json b/package.json index a55e0be..fdd3f21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dxfrontier/cds-ts-repository", - "version": "2.0.4", + "version": "2.0.5", "description": "The goal of SAP CAP CDS-QL BaseRepository is to significantly reduce the boilerplate code required to implement data access layers for persistance entities by providing out of the box actions on the database like .create(), .createMany(), .getAll(), .update(), .find(), .exists() ...", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/test/unit/draft/SELECT.test.ts b/test/unit/draft/SELECT.test.ts index 724205e..55a40e1 100644 --- a/test/unit/draft/SELECT.test.ts +++ b/test/unit/draft/SELECT.test.ts @@ -190,7 +190,7 @@ describe('SELECT - drafts', () => { const limit = await bookEventDraftRepository .builderDraft() .find({ types: 'BOOK_LUNCH' }) - .limit({ limit: 1, skip: 1 }) + .paginate({ limit: 1, skip: 1 }) .execute(); expect(limit).toHaveLength(1);