MNB PHPExcelDeveloper Guide
Database library

Standalone Database capabilities

Format-neutral PDO import, validation, and mapping features.

The Database library accepts iterable rows or rows supplied by an installed format reader. It owns mapping, validation, previews, prepared SQL batches, duplicate strategies, domain presets, manifests, and failed-row output.

Package
1
Database
Capabilities
13
Documented for this library
Feature groups
8
Package-specific responsibilities

Updated

LevelAll levelsReading time5 minPackagemnb/mnb-phpexcel-database

What you will learn

  • Understand which workflows are format-neutral.
  • Separate Database features from format-reader responsibilities.
  • Choose the mapping, validation, domain, or resume guide.

What this library includes

This page is limited to mnb/mnb-phpexcel-database. Features from the monolithic package or another individual library are not mixed into this list.

Installcomposer require mnb/mnb-phpexcel-database:^2.0
Primary APIMnb\PHPExcel\Import\SqlImporter
ScopeIndividual libraryFocused dependency and package-local API

Package quick start

The example uses the individual-library API documented by this feature page.

database-features.php
<?php

require __DIR__ . '/vendor/autoload.php';

use Mnb\PHPExcel\Import\SqlImporter;

$importer = new SqlImporter($pdo);
$result = $importer->import($rows, 'products', [
    'mapping' => ['SKU' => 'sku', 'Price' => 'price'],
    'unique_by' => ['sku'],
    'duplicate_strategy' => 'update',
]);

Supported capabilities

Search the capabilities owned by this package and open the matching package-specific guide.

13 of 13 features

Connections1 capabilities
FeatureWhat it doesTypical useSupportGuide
PDO connection helpersCreate and validate supported PDO connections using explicit configuration.Import servicesSupportedOpen guide
Import2 capabilities
FeatureWhat it doesTypical useSupportGuide
Prepared batch insertionInsert validated rows in bounded prepared-statement batches.High-volume persistenceSupportedOpen guide
Transactions and rollback controlsControl transaction boundaries and failure behavior.Reliable bulk importsSupportedOpen guide
Mapping2 capabilities
FeatureWhat it doesTypical useSupportGuide
Header detection and mapping suggestionsPreview source headers and suggest target fields with confidence values.User-assisted importsSupportedOpen guide
Explicit transformations and normalizersRename fields, normalize values, apply defaults, and transform records.ETL workflowsSupportedOpen guide
Validation2 capabilities
FeatureWhat it doesTypical useSupportGuide
Field and cross-field rulesValidate required values, types, formats, ranges, and relationships.Clean database writesSupportedOpen guide
Source row preservationKeep original source row numbers in validation and failed-row output.Actionable upload feedbackSupportedOpen guide
Duplicates1 capabilities
FeatureWhat it doesTypical useSupportGuide
Insert, update, skip, and error strategiesResolve existing records using configured unique keys.Product and customer synchronizationSupportedOpen guide
Domains1 capabilities
FeatureWhat it doesTypical useSupportGuide
Built-in import presetsUse schemas for users, products, orders, inventory, students, attendance, marks, contacts, locations, posts, media, and categories.Common application datasetsSupportedOpen guide
Operations3 capabilities
FeatureWhat it doesTypical useSupportGuide
Preview and dry-run workflowsInspect mappings, normalized records, and validation failures before persistence.Safer user confirmationSupportedOpen guide
Failed-row CSV outputWrite rejected source records and errors for correction.Import support workflowsSupportedOpen guide
Manifests and resumable statePersist format-neutral checkpoints and import progress.Long-running jobsSupportedOpen guide
Export1 capabilities
FeatureWhat it doesTypical useSupportGuide
Database cursor integrationStream PDO query results into an installed output writer.Large database exportsSupportedOpen guide

Feature boundaries

These limits prevent individual-library documentation from being confused with the complete monolithic package.

CapabilityStatusWhat to use instead
Opening XLSX, XLS, CSV, JSON, XML, or ODS filesPartially supported: Install the relevant format package; Database itself is format-neutral.Install the relevant format package; Database itself is format-neutral.
Direct large XLSX chunk orchestrationNot supported: Install mnb/mnb-phpexcel-database-xlsx for the XLSX-specific bridge.Install mnb/mnb-phpexcel-database-xlsx for the XLSX-specific bridge.
Spreadsheet presentation and workbook writingNot supported: Presentation belongs to the selected format writer.Presentation belongs to the selected format writer.