[PR #117] [CLOSED] Add a convenient Limit fetch clause #464

Closed
opened 2025-12-29 18:27:09 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JohnEstropia/CoreStore/pull/117
Author: @ThibaultVlacich
Created: 10/26/2016
Status: Closed

Base: swift3_developHead: feature/limit-fetch-clause


📝 Commits (1)

📊 Changes

4 files changed (+221 additions, -0 deletions)

View changed files

📝 CoreStore.xcodeproj/project.pbxproj (+28 -0)
CoreStoreTests/LimitTests.swift (+44 -0)
Sources/Fetching and Querying/Concrete Clauses/Limit.swift (+57 -0)
Sources/ObjectiveC/CSLimit.swift (+92 -0)

📄 Description

This PR add a Limit fetch clause, to easily provide a fetch limit in a request.

So this :

CoreStore.fetchAll(
    From(Article),
    OrderBy(.descending("date")),
    Tweak { fetchRequest -> Void in
         fetchRequest.fetchLimit = 10
    }
)

becomes this :

CoreStore.fetchAll(
    From(Article),
    OrderBy(.descending("date")),
    Limit(10)
)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JohnEstropia/CoreStore/pull/117 **Author:** [@ThibaultVlacich](https://github.com/ThibaultVlacich) **Created:** 10/26/2016 **Status:** ❌ Closed **Base:** `swift3_develop` ← **Head:** `feature/limit-fetch-clause` --- ### 📝 Commits (1) - [`ffdd8ba`](https://github.com/JohnEstropia/CoreStore/commit/ffdd8ba1e6ad93b9d5880fc3e4c144455053bfd7) Add a Limit fetch clause ### 📊 Changes **4 files changed** (+221 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CoreStore.xcodeproj/project.pbxproj` (+28 -0) ➕ `CoreStoreTests/LimitTests.swift` (+44 -0) ➕ `Sources/Fetching and Querying/Concrete Clauses/Limit.swift` (+57 -0) ➕ `Sources/ObjectiveC/CSLimit.swift` (+92 -0) </details> ### 📄 Description This PR add a `Limit` fetch clause, to easily provide a fetch limit in a request. So this : ``` swift CoreStore.fetchAll( From(Article), OrderBy(.descending("date")), Tweak { fetchRequest -> Void in fetchRequest.fetchLimit = 10 } ) ``` becomes this : ``` swift CoreStore.fetchAll( From(Article), OrderBy(.descending("date")), Limit(10) ) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 18:27:09 +01:00
adam closed this issue 2025-12-29 18:27:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore-JohnEstropia#464