mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Remove misleading documentation
Limiting to-many associations does not do what this false documentation is saying
This commit is contained in:
1 parent
a3279c9f63
commit
e66e59cd21
2 files changed
+19
-30
No files matched your search
@@ -857,10 +857,6 @@ Before we describe them in detail, let's see a few requests they can build:
|
||||
let request = Author
|
||||
.including(all: Author.books)
|
||||
|
||||
/// All authors with their three most popular books
|
||||
let request = Author
|
||||
.including(all: Author.books.order(Column("popularity").desc).limit(3))
|
||||
|
||||
/// All authors with their awarded books
|
||||
let request = Author
|
||||
.including(all: Author.books.having(Book.awards.isEmpty == false))
|
||||
@@ -1275,26 +1271,6 @@ To specify the default selection for all inclusions of a given type, see [Column
|
||||
|
||||
Associations support more refinements:
|
||||
|
||||
- `limit`
|
||||
|
||||
Fetch all authors with their three most popular books:
|
||||
|
||||
```swift
|
||||
struct AuthorInfo: FetchableRecord, Decodable {
|
||||
var author: Author
|
||||
var books: [Book]
|
||||
}
|
||||
|
||||
let mostPopularBooks = Author.books
|
||||
.order(Column("popularity").desc)
|
||||
.limit(3)
|
||||
|
||||
let authorInfos: [AuthorInfo] = try Author
|
||||
.including(all: mostPopularBooks)
|
||||
.asRequest(of: AuthorInfo.self)
|
||||
.fetchAll(db)
|
||||
```
|
||||
|
||||
- `distinct`
|
||||
|
||||
Fetch all authors with the kinds of books they write (novels, poems, plays, etc):
|
||||
|
||||
+19
-6
@@ -78,8 +78,10 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<RemoteRunnable
|
||||
runnableDebuggingMode = "2"
|
||||
BundleIdentifier = "com.apple.Carousel"
|
||||
RemotePath = "/GRDBDemoiOS">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
@@ -87,7 +89,7 @@
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</RemoteRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
@@ -95,8 +97,10 @@
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<RemoteRunnable
|
||||
runnableDebuggingMode = "2"
|
||||
BundleIdentifier = "com.apple.Carousel"
|
||||
RemotePath = "/GRDBDemoiOS">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
@@ -104,7 +108,16 @@
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</RemoteRunnable>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "568E5FBE1E926430002582E0"
|
||||
BuildableName = "GRDBDemoWatchOS.app"
|
||||
BlueprintName = "GRDBDemoWatchOS"
|
||||
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
|
||||
Reference in new issue
Block a user