mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
typo
This commit is contained in:
1 parent
82765aba1d
commit
f69c79bc1a
1 file changed
+3
-3
@@ -1423,7 +1423,7 @@ struct AuthorInfo: Decodable, FetchableRecord {
|
||||
// LEFT JOIN book ON book.authorId = author.id
|
||||
// GROUP BY author.id
|
||||
let request = Author.annotate(with: Author.books.count)
|
||||
let authorInfos = AuthorInfo.fetchAll(db, request)
|
||||
let authorInfos = try AuthorInfo.fetchAll(db, request)
|
||||
|
||||
for info in authorInfo {
|
||||
print("\(info.author.name) wrote \(info.bookCount) book(s).")
|
||||
@@ -1470,7 +1470,7 @@ let request = Author
|
||||
.annotate(with: Author.books.avg(Column("price")))
|
||||
.annotate(with: Author.books.sum(Column("price")))
|
||||
|
||||
if let authorInfo = AuthorInfo.fetchOne(db, request) {
|
||||
if let authorInfo = try AuthorInfo.fetchOne(db, request) {
|
||||
print(info.author.name)
|
||||
print("number of books: \(info.bookCount)")
|
||||
print("minimum book price: \(info.minBookPrice)")
|
||||
@@ -1513,7 +1513,7 @@ let request = Author
|
||||
.annotate(with: Author.books
|
||||
.filter(Column("kind") == "theatrePlay")
|
||||
.forKey("theatrePlay"))
|
||||
let authorInfos = AuthorInfo.fetchAll(db, request)
|
||||
let authorInfos = try AuthorInfo.fetchAll(db, request)
|
||||
|
||||
for info in authorInfo {
|
||||
...
|
||||
|
||||
Reference in new issue
Block a user