fetchAll(_:keys:)
Returns an array of records identified by their primary keys.
static func fetchAll(_ db: Database, keys: some Collection<some DatabaseValueConvertible>) throws -> [Self]
Parameters
Returns
An array of records.
Throws
A DatabaseError
whenever an SQLite error occurs.
For example:
try dbQueue.read { db in
let players = try Player.fetchAll(db, keys: [1, 2, 3])
let countries = try Country.fetchAll(db, keys: ["FR", "US"])
}
The order in which the records are returned is undefined (ref).