Applying .limit() to .fetchAll(sql:arguments:)

Is this possible? I'm getting a compiler error in GRDB 5.21.0:

        let pattern = FTS3Pattern(matchingPhrase: searchQuery.lowercased())

            try databaseReader.read { db in
                fetched = try Paragraph
                    .limit(50)
                    .fetchAll(db, sql: sql, arguments: [pattern]) // Extra arguments at positions #2, #3 in call
            }

regards,
Michael

No, @mazz, this is not possible. If you want to limit the number of results fetched from your raw SQL request, do it at the SQL level, with SELECT ... LIMIT 50.

1 Like

That works, thanks.