You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/SessionUtilitiesKit/Database/Utilities/FetchRequest+Utilities.swift

12 lines
346 B
Swift

// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
import GRDB
public extension FetchRequest where RowDecoder: DatabaseValueConvertible {
func fetchOne(_ db: Database, orThrow error: Error) throws -> RowDecoder {
guard let result: RowDecoder = try fetchOne(db) else { throw error }
return result
}
}