Only chunk if rows exceeds sqlite variables limit (999) (#1270)

This commit is contained in:
MartinOscar 2025-04-17 22:24:57 +02:00 committed by GitHub
parent 22a0a52f7b
commit 038504fbec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,7 +184,11 @@ class File extends Model
]; ];
}, $contents); }, $contents);
$this->sushiInsertChunkSize = min((int) floor(999 / count($this->getSchema())), count($rows)); $rowCount = count($rows);
$limit = 999;
if ($rowCount > $limit) {
$this->sushiInsertChunkSize = min(floor($limit / count($this->getSchema())), $rowCount);
}
return $rows; return $rows;
} catch (Exception $exception) { } catch (Exception $exception) {