Standalone Database + XLSX bridge
PHP XLSX-to-PDO Import Library for Large Database Workflows
Use the standalone Database + XLSX bridge when a job specifically needs native large-file XLSX streaming coordinated directly with PDO validation, mapping, chunked database writes, resume manifests, and failed-row output.
Composer
composer require mnb/mnb-phpexcel-database-xlsx:^2.0- Package
mnb/mnb-phpexcel-database-xlsx- Entry API
Mnb\PHPExcel\Large\LargeExcelDatabaseImportEngine- Runtime
- PHP 8.1+
- Format
- .xlsx → PDO
Choose your Database XLSX workflow#
01
Stream one XLSX sheet into PDOChoose a worksheet, map rows, validate records, tune chunk and SQL batch sizes, and write through prepared PDO operations.
Large import →02Map workbook sheets to database tablesCoordinate multi-sheet XLSX sources where each worksheet owns a specific table or import responsibility.
Workbook import →03Resume safely and preserve failed rowsPersist checkpoints, report invalid source rows, keep progress observable, and make chunk replay idempotent.
Resume & failures →04Check the bridge boundaryReview exactly what XLSX, Database, Core, and the coordination layer each contribute before installing the integration.
Feature matrix →Use the right Database XLSX API#
| Task | Primary API | Choose it when |
|---|---|---|
| Import one XLSX sheet to a table | LargeExcelDatabaseImportEngine::importToSql() | A large worksheet should stream through validation and mapping into one PDO table with bounded memory. |
| Import multiple sheets to tables | importWorkbookToSql() | A workbook contains several logical datasets that map to separate database tables. |
| Resume after interruption | manifest_path + resume | Chunk progress must survive worker restarts or long-running import interruptions. |
| Import rows that are already iterable | SqlImporter::importRows() | Use the Database package alone when XLSX parsing and chunk orchestration are not part of this service boundary. |
What the Database XLSX bridge covers#
Native large-file worksheet streaming
- Focused XLSX reader and row normalization
- Worksheet selection and chunk delivery
- Bounded-memory processing for large sources
- Physical source-row numbers preserved downstream
PDO validation and writes
- Mapping, validation and normalization
- Prepared SQL batches and transaction controls
- Duplicate strategies and unique business keys
- Failed-row output for correction and replay
Resume-aware orchestration
- Independent chunk and SQL batch sizes
- Progress callbacks and persisted manifests
- Single-sheet and workbook-to-table workflows
- Replay-safe resume behavior for long jobs
Package boundary: mnb/mnb-phpexcel-database-xlsx coordinates Core, XLSX, and Database for direct large-XLSX-to-PDO workflows. Use mnb/mnb-phpexcel-database alone when your application already has iterable rows and does not need XLSX chunk orchestration.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue