PHPackages                             cryptoman3/doctrine-dbal-bulk - 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. cryptoman3/doctrine-dbal-bulk

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

cryptoman3/doctrine-dbal-bulk
=============================

Bulk inserts and updates for Doctrine DBAL

1.x-dev(2y ago)0858MITPHPPHP ~8.1 || ~8.2

Since Jul 24Pushed 2y agoCompare

[ Source](https://github.com/cryptoman3/doctrine-dbal-bulk)[ Packagist](https://packagist.org/packages/cryptoman3/doctrine-dbal-bulk)[ RSS](/packages/cryptoman3-doctrine-dbal-bulk/feed)WikiDiscussions 1.x Synced 1mo ago

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

Doctrine Bulk
=============

[](#doctrine-bulk)

Contributing
============

[](#contributing)

This repo is **READ ONLY**, in order to contribute to Flow PHP project, please open PR against [flow](https://github.com/flow-php/flow) monorepo.

Changes merged to monorepo are automatically propagated into sub repositories.

Description
-----------

[](#description)

Doctrine Bulk is missing bulk upsert/insert abstraction for Doctrine DBAL.

Installation
------------

[](#installation)

```
composer require flow-php/doctrine-dbal-bulk:1.x@dev

```

Usage Examples
--------------

[](#usage-examples)

Insert:

```
$bulk = Bulk::create();
$bulk->insert(
    $dbalConnection,
    'your-table-name',
    new BulkData([
        ['id' => 1, 'name' => 'Name One', 'description' => 'Description One'],
        ['id' => 2, 'name' => 'Name Two', 'description' => 'Description Two'],
        ['id' => 3, 'name' => 'Name Three', 'description' => 'Description Three'],
    ])
);
```

Update:

```
$bulk = Bulk::create();
$bulk->update(
    $dbalConnection,
    'your-table-name',
    new BulkData([
        ['id' => 1, 'name' => 'Name One', 'description' => 'Description One'],
        ['id' => 2, 'name' => 'Name Two', 'description' => 'Description Two'],
        ['id' => 3, 'name' => 'Name Three', 'description' => 'Description Three'],
    ]),
    [
        'primary_key_columns' => ['id'],
        'update_columns' => ['name']
    ]
);
```

Supported Dialects
------------------

[](#supported-dialects)

- PostgreSQL

### Adding new Dialects

[](#adding-new-dialects)

[Dialect](src/Flow/Doctrine/Bulk/Dialect/Dialect.php) is basic abstraction of this library.
The main role of Dialect is to prepare SQL insert/update statement based on [BulkData](src/Flow/Doctrine/Bulk/BulkData.php)and provided `options`.

- `$insertOptions`
- `$updateOptions`

Options are key =&gt; value maps without predefined structure that allows to manipulate building SQL statement. Each dialect should define it own structure for options in order to support db engine features, including those that are specific for given engine.

[QueryFactory](src/Flow/Doctrine/Bulk/QueryFactory.php) is abstraction for creating queries, there is currently only one implementation, DbalPlatform. QueryFactory `insertOptions` and `updateOptions` is combination of all options provided by supported Dialects where each entry must be optional.

example: `dialect_option?: string`

[DbalPlatform](src/Flow/Doctrine/Bulk/DbalPlatform.php) is a factory that detects which Dialect should be used for given Doctrine DBAL Platform.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1022d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/552102c66f113f5204c37fd5591031aabf1fdc2e3d1fb01f383765d180fae7f5?d=identicon)[cryptoman3](/maintainers/cryptoman3)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (82 commits)")[![aeon-automation](https://avatars.githubusercontent.com/u/77585774?v=4)](https://github.com/aeon-automation "aeon-automation (37 commits)")[![norberttech](https://avatars.githubusercontent.com/u/1921950?v=4)](https://github.com/norberttech "norberttech (34 commits)")[![tomaszhanc](https://avatars.githubusercontent.com/u/7013293?v=4)](https://github.com/tomaszhanc "tomaszhanc (26 commits)")[![DawidSajdak](https://avatars.githubusercontent.com/u/946972?v=4)](https://github.com/DawidSajdak "DawidSajdak (11 commits)")[![cryptoman3](https://avatars.githubusercontent.com/u/31904201?v=4)](https://github.com/cryptoman3 "cryptoman3 (2 commits)")[![owsiakl](https://avatars.githubusercontent.com/u/9623965?v=4)](https://github.com/owsiakl "owsiakl (1 commits)")

---

Tags

doctrinedbalinsertbulkupsert

### Embed Badge

![Health badge](/badges/cryptoman3-doctrine-dbal-bulk/health.svg)

```
[![Health](https://phpackages.com/badges/cryptoman3-doctrine-dbal-bulk/health.svg)](https://phpackages.com/packages/cryptoman3-doctrine-dbal-bulk)
```

###  Alternatives

[flow-php/doctrine-dbal-bulk

Bulk inserts and updates for Doctrine DBAL

14295.2k1](/packages/flow-php-doctrine-dbal-bulk)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[vlucas/spot2

Simple DataMapper built on top of Doctrine DBAL

605392.8k7](/packages/vlucas-spot2)[jsor/doctrine-postgis

Spatial and Geographic Data with PostGIS and Doctrine.

2191.6M1](/packages/jsor-doctrine-postgis)[larapack/doctrine-support

Better Doctrine Support with Laravel (Support for `enum`)

1752.3M55](/packages/larapack-doctrine-support)

PHPackages © 2026

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