mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Document the type of variables
This commit is contained in:
1 parent
3407715599
commit
bda63c70bf
1 file changed
+2
-2
@@ -199,7 +199,7 @@ This request, of type `QueryInterfaceRequest<Void>`, doesn't quite know what to
|
||||
let cte = CommonTableExpression(...)
|
||||
let request = cte.all().with(cte).asRequest(of: Player.self)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
let players = try request.fetchAll(db)
|
||||
let players = try request.fetchAll(db) // [Player]
|
||||
```
|
||||
|
||||
2. Provide the fetched type to the cte itself:
|
||||
@@ -208,7 +208,7 @@ This request, of type `QueryInterfaceRequest<Void>`, doesn't quite know what to
|
||||
let cte = CommonTableExpression<Player>(...)
|
||||
// ~~~~~~~~
|
||||
let request = cte.all().with(cte)
|
||||
let players = try request.fetchAll(db)
|
||||
let players = try request.fetchAll(db) // [Player]
|
||||
```
|
||||
|
||||
For example, let's fetch a range of integer:
|
||||
|
||||
Reference in new issue
Block a user