PHPackages                             nomensa/bulk-inserter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. nomensa/bulk-inserter

ActiveLibrary[Database &amp; ORM](/categories/database)

nomensa/bulk-inserter
=====================

v0.3.0(8y ago)11.0k2MITPHPPHP &gt;=7.1.3

Since Mar 26Pushed 8y ago3 watchersCompare

[ Source](https://github.com/nomensa/bulk-inserter)[ Packagist](https://packagist.org/packages/nomensa/bulk-inserter)[ RSS](/packages/nomensa-bulk-inserter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Bulk Inserter
=============

[](#bulk-inserter)

*Note: This helper library is currently specific to the Laravel framework running with a MySQL database.*

If you are stress-testing your new application to see how it will behave with a realistic future amount of data then you are probably writing a seeder which inserts thousands of rows.

Using many individual queries in PHP to insert rows one-by-one may be slow and hampering development or even breaching prepared statement limits.

This package utilises MySQLs native dump import so you can prepare the data inside your loop and then plonk the whole lot in the database with 1 speedy operation which is way quicker than doing lots of individual inserts!

Install
-------

[](#install)

```
$ composer require --dev -- nomensa/bulk-inserter
```

*Note: Please install as a dev requirement only.*

Example
-------

[](#example)

The following example will insert a thousand users in a couple of seconds:

```
use Nomensa\BulkInserter\BulkInserter;

class ExampleSeeder
{

    public function run()
    {
        $bulkInserter = new BulkInserter('users',['name','email']);

        for ($i = 0; $i < 1000; $i++) {
            $bulkInserter->addRow( '("User ' . $i . '","user' . $i . '@example.com")' );
        }

        $bulkInserter->insert();
    }

}
```

If the above task was written using the Eloquent model's '::create()' method it could take ~20 seconds.

Multiply this delay across all your model's tables, factor in how many times you will tweak and re-run your seeder during test writing and the time savings add. Using this package makes for a much happier developer experience.

Friendly reminder about exposing vulnerabilities!
-------------------------------------------------

[](#friendly-reminder-about-exposing-vulnerabilities)

This package executes raw MySQL code in your database. DO NOT use this package in a production environment and certainly NEVER populate the content of the rows via inputs from a request.

This package is for use during development and testing, not everyday application logic.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

2955d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2af52bddb00d0847df9fd5fc07df7093e5829dfc2790b3f94646fe3a5aafe6b7?d=identicon)[nomensa](/maintainers/nomensa)

---

Top Contributors

[![martinjoiner](https://avatars.githubusercontent.com/u/1795947?v=4)](https://github.com/martinjoiner "martinjoiner (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nomensa-bulk-inserter/health.svg)

```
[![Health](https://phpackages.com/badges/nomensa-bulk-inserter/health.svg)](https://phpackages.com/packages/nomensa-bulk-inserter)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
