Static Methodgrdb 7.3.0GRDB

fetchSet(_:keys:)

Returns a set of records identified by the provided unique keys (primary key or any key with a unique index on it).

FetchableRecord+TableRecord.swift:528
static func fetchSet(_ db: Database, keys: [[String : (any DatabaseValueConvertible)?]]) throws -> Set<Self>

Parameters

db

A database connection.

keys

An array of key dictionaries.

Returns

A set of records.

Throws

A DatabaseError whenever an SQLite error occurs.

For example:

try dbQueue.read { db in
    let players = try Player.fetchSet(db, keys: [
        ["email": "a@example.com"],
        ["email": "b@example.com"]])
}