{"id":20816067,"url":"https://github.com/arillo/silverstripe-multidb","last_synced_at":"2026-07-03T22:04:33.529Z","repository":{"id":62487032,"uuid":"148664846","full_name":"arillo/silverstripe-multidb","owner":"arillo","description":null,"archived":false,"fork":false,"pushed_at":"2018-09-13T16:25:39.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-18T15:51:55.026Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-13T16:15:45.000Z","updated_at":"2018-09-13T16:25:40.000Z","dependencies_parsed_at":"2022-11-02T09:31:03.517Z","dependency_job_id":null,"html_url":"https://github.com/arillo/silverstripe-multidb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-multidb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-multidb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-multidb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fsilverstripe-multidb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arillo","download_url":"https://codeload.github.com/arillo/silverstripe-multidb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243163883,"owners_count":20246598,"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-17T21:27:53.196Z","updated_at":"2025-10-28T14:35:39.617Z","avatar_url":"https://github.com/arillo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arillo\\MultiDB\n\n*[Experimental]* Simple DataObject proxy helping to persist records in multiple databases.\n\n[![Latest Stable Version](https://poser.pugx.org/arillo/silverstripe-multidb/v/stable?format=flat)](https://packagist.org/packages/arillo/silverstripe-multidb)\n\u0026nbsp;\n[![Total Downloads](https://poser.pugx.org/arillo/silverstripe-multidb/downloads?format=flat)](https://packagist.org/packages/arillo/silverstripe-multidb)\n\n### Requirements\n\nSilverStripe CMS ^4.0\n\n### Installation\n\n```bash\ncomposer require arillo/silverstripe-multidb\n```\n\n### Usage\n\n```php\n\u003c?php\nuse SilverStripe\\ORM\\DataObject;\n\nclass MyDataObject extends DataObject\n{\n    private static\n        $table_name = 'MyDataObject',\n\n        $db = [\n            'Email' =\u003e 'Varchar(255)',\n            'FirstName' =\u003e 'Varchar(255)',\n            'Surname' =\u003e 'Varchar(255)',\n        ],\n\n        $summary_fields = [\n            'Email' =\u003e 'Email',\n            'FirstName' =\u003e 'FirstName',\n            'Surname' =\u003e 'Surname',\n        ]\n    ;\n}\n\nuse Arillo\\MultiDB\\DataObjectProxy;\n\nclass MyDataObjectProxy extends DataObjectProxy\n{\n    private static\n        $dataobject_class = MyDataObject::class\n    ;\n\n    public static function db_config()\n    {\n        // Medoo configurations (@see https://medoo.in/api/new)\n        return [\n            'database_type' =\u003e 'mysql',\n            'database_name' =\u003e \u003cdb_name\u003e,\n            'server' =\u003e \u003cserver\u003e,\n            'username' =\u003e \u003cusername\u003e,\n            'password' =\u003e \u003cpw\u003e,\n        ];\n    }\n}\n\n// get all\n$records = MyDataObjectProxy::get();\n\n// create\n$item = MyDataObjectProxy::create([\n    'Email' =\u003e 'some@email.com',\n]);\n\n// save it\n$item-\u003ewrite();\n\n$item-\u003eexists(); // true\n\n// update record\n$item-\u003eupdate([\n    'Email' =\u003e 'updated@email.com',\n])-\u003ewrite();\n\n\\SilverStripe\\Dev\\Debug::dump($item);\n\n// delete record\n$item-\u003edelete();\n\n```\n\n### @TODO\n\n* tests\n* migrations\n* ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fsilverstripe-multidb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farillo%2Fsilverstripe-multidb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fsilverstripe-multidb/lists"}