I am using the SQLite.swift library and running raw queries.
I have the following
let results = try db!.prepare("""
SELECT class from "character" where character_id = ?
""", character.id
)
Does anyone know how to get the number of rows returned? (or more specifically whether it returns any rows).
I know I can loop through results, but was looking for a more efficient way.
You can add a subquery with the count to your query
fiddle