DB + XLSX library
Resume, Progress, and Failed Rows
Persist large XLSX import checkpoints, resume safely, report invalid source rows, and design idempotent replay behavior.
LargeImportManifestLargeFailedRowsCsvWriterprogressMake replay safe#
- Create a stable database unique index for the business key.
- Use
duplicate_strategy=skiporupdatewhen replay is possible. - Keep the source workbook unchanged while its manifest remains active.
- Store the manifest and failed-row CSV outside the public web root.
- Delete or archive the manifest only after the import is conclusively complete.
Use progress as observability#
$result = $engine->importToSql($path, $pdo, 'orders', [
'progress' => static function (array $state): void {
printf(
"Rows: %d | Inserted: %d | Failed: %d\n",
$state['rows_scanned'] ?? 0,
$state['inserted_rows'] ?? 0,
$state['failed_rows'] ?? 0,
);
},
]);Preserve original row numbers#
The integration keeps physical worksheet row numbers in validation and failed-row output so uploaders can correct the exact row in the source workbook.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue