PHPackages                             dflydev/identity-generator-dbal - 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. dflydev/identity-generator-dbal

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

dflydev/identity-generator-dbal
===============================

Provides a Doctrine DBAL implementation of the identity generator data store.

v1.0.1(13y ago)175MITPHPPHP &gt;=5.3.2

Since Jul 14Pushed 13y ago1 watchersCompare

[ Source](https://github.com/dflydev/dflydev-identity-generator-dbal)[ Packagist](https://packagist.org/packages/dflydev/identity-generator-dbal)[ Docs](https://github.com/dflydev/dflydev-identity-generator-dbal)[ RSS](/packages/dflydev-identity-generator-dbal/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Doctrine DBAL Identity Generator Data Store
===========================================

[](#doctrine-dbal-identity-generator-data-store)

Provides a Doctrine DBAL implementation of the identity generator data store. For more information see: [dflydev/identity-generator](https://github.com/dflydev/dflydev-identity-generator)

Requirements
------------

[](#requirements)

- PHP 5.3+
- Doctrine DBAL 2.2.\*

Implementation Details
----------------------

[](#implementation-details)

This simple dflydev/identity-generator Data Store implementation relies on blindly inserting records into a database.

It works under the assumption that if the underlying database has a unique constraint configured for either an identity column or a unique constraint configured for both and identity and mob column an exception will be thrown.

It attempts to capture this exception and determine whether or not there is a fault in the underlying connection or if it was due to a constraint violation. It does this by way of looking for ANSI SQL Error State Code `23000`.

Schemas
-------

[](#schemas)

The following are very naive examples of database schemas that will work with this data store. They may work for you for testing but please do not blindly use them for production.

### SQLite

[](#sqlite)

If mobs are not required simply create a table with one column marked as `unique`.

```
CREATE TABLE identity (
    identity string(64) unique
);

```

If mobs are required create a table with two columns and create a unique constraint across both columns.

```
CREATE TABLE identityWithMob (
    identity string(64),
    mob string(64),
    constraint id unique (identity, mob)
);

```

### Mysql

[](#mysql)

If mobs are not required simply create a table with one column marked as `unique`.

```
CREATE TABLE identity (
    identity varchar(64) unique
);

```

If mobs are required create a table with two columns and create a unique index across both columns.

```
CREATE TABLE identityWithMob (
    identity varchar(64),
    mob varchar(64),
    unique index (identity, mob)
);

```

Usage
-----

[](#usage)

```
use Dflydev\IdentityGenerator\DataStore\Dbal\DataStore;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\DriverManager;

$config = new Configuration();
$connectionParams = array(); // driver specific connection configuration
$connection = DriverManager::getConnection($connectionParams, $config);

// Create a Data Store that does not support a mob.
$dataStore = new DataStore(
    $connection,
    'tableName',
    'identityColumnName'
);

// Create a Data Store that supports a mob.
$dataStoreWithMob = new DataStore(
    $connection,
    'tableName',
    'identityColumnName',
    'mobColumnName'
);

```

License
-------

[](#license)

This library is licensed under the New BSD License - see the LICENSE file for details.

Community
---------

[](#community)

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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 ~92 days

Total

2

Last Release

4960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d6029bd16a0e8a9b97358a75b54affa6baadc1d9b0ca7eab2b6dd6c681ad7a8?d=identicon)[simensen](/maintainers/simensen)

---

Top Contributors

[![simensen](https://avatars.githubusercontent.com/u/191200?v=4)](https://github.com/simensen "simensen (5 commits)")

---

Tags

generatordoctrinedbalidentitygenerationid

### Embed Badge

![Health badge](/badges/dflydev-identity-generator-dbal/health.svg)

```
[![Health](https://phpackages.com/badges/dflydev-identity-generator-dbal/health.svg)](https://phpackages.com/packages/dflydev-identity-generator-dbal)
```

###  Alternatives

[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)[friendsofdoctrine/dbal-clickhouse

Doctrine DBAL driver for ClickHouse

1141.2M1](/packages/friendsofdoctrine-dbal-clickhouse)

PHPackages © 2026

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