         }
 
         if SwiftData.EnableForeignKeys {
-            executeQueryUnsafe("PRAGMA foreign_keys=ON", factory: IntFactory)
+            pragma("foreign_keys=ON", factory: IntFactory)
         }
 
         // Retry queries before returning locked errors.

            return Cursor<T>(err: error)
        }

        let cursor = FilledSQLiteCursor<T>(statement: statement!, factory: factory)

        // Close, not reset -- this isn't going to be reused, and the cursor has
        // consumed everything.
        statement?.close()

        return cursor
    }

    func writeCorruptionInfoForDBNamed(dbFilename: String, toLogger logger: XCGLogger) {

        // For where these values come from, see Bug 1213623.
        //

        let currentPageSize = pragma("page_size", factory: IntFactory)
        let desiredPageSize = 32 * 1024

        // This has to be done without WAL, so we always hop into rollback/delete journal mode.
