{"id":21819373,"url":"https://github.com/dflydev/dflydev-identity-generator-dbal","last_synced_at":"2026-05-17T22:32:12.351Z","repository":{"id":3712223,"uuid":"4784090","full_name":"dflydev/dflydev-identity-generator-dbal","owner":"dflydev","description":"Provides a Doctrine DBAL implemetnation of the identity generator data store.","archived":false,"fork":false,"pushed_at":"2012-10-15T03:50:18.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T07:11:14.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dflydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-25T16:23:41.000Z","updated_at":"2013-10-21T09:02:07.000Z","dependencies_parsed_at":"2022-08-21T09:50:45.430Z","dependency_job_id":null,"html_url":"https://github.com/dflydev/dflydev-identity-generator-dbal","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-identity-generator-dbal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-identity-generator-dbal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-identity-generator-dbal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-identity-generator-dbal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflydev","download_url":"https://codeload.github.com/dflydev/dflydev-identity-generator-dbal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244779896,"owners_count":20509232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T16:18:42.681Z","updated_at":"2026-05-17T22:32:07.306Z","avatar_url":"https://github.com/dflydev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Doctrine DBAL Identity Generator Data Store\n===========================================\n\nProvides a Doctrine DBAL implementation of the identity generator\ndata store. For more information see:\n[dflydev/identity-generator](https://github.com/dflydev/dflydev-identity-generator)\n\n\nRequirements\n------------\n\n * PHP 5.3+\n * Doctrine DBAL 2.2.*\n\n\nImplementation Details\n----------------------\n\nThis simple dflydev/identity-generator Data Store implementation relies on\nblindly inserting records into a database.\n\nIt works under the assumption that if the underlying database has a unique\nconstraint configured for either an identity column or a unique constraint\nconfigured for both and identity and mob column an exception will be thrown.\n\nIt attempts to capture this exception and determine whether or not there is a fault\nin the underlying connection or if it was due to a constraint violation. It\ndoes this by way of looking for ANSI SQL Error State Code `23000`.\n\n\nSchemas\n-------\n\nThe following are very naive examples of database schemas that will work with\nthis data store. They may work for you for testing but please do not blindly\nuse them for production.\n\n\n### SQLite\n\nIf mobs are not required simply create a table with one column marked as `unique`.\n\n    CREATE TABLE identity (\n        identity string(64) unique\n    );\n\nIf mobs are required create a table with two columns and create a unique constraint\nacross both columns.\n\n    CREATE TABLE identityWithMob (\n        identity string(64),\n        mob string(64),\n        constraint id unique (identity, mob)\n    );\n\n\n### Mysql\n\nIf mobs are not required simply create a table with one column marked as `unique`.\n\n    CREATE TABLE identity (\n        identity varchar(64) unique\n    );\n\nIf mobs are required create a table with two columns and create a unique index\nacross both columns.\n\n    CREATE TABLE identityWithMob (\n        identity varchar(64),\n        mob varchar(64),\n        unique index (identity, mob)\n    );\n\n\nUsage\n-----\n\n    use Dflydev\\IdentityGenerator\\DataStore\\Dbal\\DataStore;\n    use Doctrine\\DBAL\\Configuration;\n    use Doctrine\\DBAL\\DriverManager;\n    \n    $config = new Configuration();\n    $connectionParams = array(); // driver specific connection configuration\n    $connection = DriverManager::getConnection($connectionParams, $config);\n\n    // Create a Data Store that does not support a mob.\n    $dataStore = new DataStore(\n        $connection,\n        'tableName',\n        'identityColumnName'\n    );\n\n    // Create a Data Store that supports a mob.\n    $dataStoreWithMob = new DataStore(\n        $connection,\n        'tableName',\n        'identityColumnName',\n        'mobColumnName'\n    );\n\n\nLicense\n-------\n\nThis library is licensed under the New BSD License - see the LICENSE file\nfor details.\n\n\nCommunity\n---------\n\nIf you have questions or want to help out, join us in the\n[#dflydev](irc://irc.freenode.net/#dflydev) channel on irc.freenode.net.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-identity-generator-dbal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflydev%2Fdflydev-identity-generator-dbal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-identity-generator-dbal/lists"}