Query Inside Loop (ARCH9064)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key swift.orm.query-inside-loop · Severity warning · Category orm
Flags raw SQL (sqlite3_prepare, sqlite3_exec, executeQuery) issued inside a loop body - broader than the Core Data / Realm N+1 rule.
Incorrect
Section titled “Incorrect”for id in ids { sqlite3_exec(db, "select ... \(id)", nil, nil, nil) }Correct
Section titled “Correct”one statement with an IN list, or a prepared statement bound per iterationBatch the query, or prepare once and bind inside the loop.