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

View File

@@ -184,7 +184,11 @@ class File extends Model
];
}, $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;
} catch (Exception $exception) {