stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.64k stars 1.56k forks source link

Pluck Codable #1004

Closed Sevyls closed 3 years ago

Sevyls commented 4 years ago

Is it possible to pluck a single Codable into a single Object, so that the result is not an array but your codable struct/class?

nathanfallet commented 3 years ago

Try with

table.pluck() { row in
    let object: MyCodableObject = row.decode() // Where `MyCodableObject` conforms to Decodable
}

I'm closing this issue for now, it it doesn't work, please reopen it.