{"id":21283738,"url":"https://github.com/affordablemobiles/eloquent-datastore","last_synced_at":"2025-07-09T05:39:53.865Z","repository":{"id":41951989,"uuid":"465768035","full_name":"affordablemobiles/eloquent-datastore","owner":"affordablemobiles","description":"Google Datastore with Laravel's Eloquent ORM","archived":false,"fork":false,"pushed_at":"2024-11-08T14:04:22.000Z","size":117,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-08T15:19:09.797Z","etag":null,"topics":["datastore","eloquent","google-datastore","laravel","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/affordablemobiles/eloquent-datastore","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/affordablemobiles.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-03T15:07:07.000Z","updated_at":"2024-11-08T14:04:26.000Z","dependencies_parsed_at":"2024-09-13T01:55:57.645Z","dependency_job_id":"d0a3fd77-aa85-4c04-b8af-24a634c577ee","html_url":"https://github.com/affordablemobiles/eloquent-datastore","commit_stats":null,"previous_names":["affordablemobiles/eloquent-datastore","a1comms/eloquent-datastore"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affordablemobiles%2Feloquent-datastore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affordablemobiles%2Feloquent-datastore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affordablemobiles%2Feloquent-datastore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affordablemobiles%2Feloquent-datastore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/affordablemobiles","download_url":"https://codeload.github.com/affordablemobiles/eloquent-datastore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225715891,"owners_count":17512912,"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":["datastore","eloquent","google-datastore","laravel","php"],"created_at":"2024-11-21T11:11:53.246Z","updated_at":"2024-11-21T11:11:53.912Z","avatar_url":"https://github.com/affordablemobiles.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Eloquent for Google Datastore\n\n![Latest Stable Version](https://poser.pugx.org/affordablemobiles/eloquent-datastore/v)\n![License](https://poser.pugx.org/affordablemobiles/eloquent-datastore/license)\n\nA package for using Google Datastore as a database driver.\n\n---\nBy using this package, you can use `query builder` and `eloquent` to access data from datastore.\n\n## Installation\n\n**This package requires Laravel 9.x \u0026 PHP 8.1 as a minimum.**\n\nYou can install the package via composer:\n\n```bash\ncomposer require affordablemobiles/eloquent-datastore\n```\n\nIf you are using Laravel Package Auto-Discovery, you don't need you to manually add the ServiceProvider.\n\n#### Without auto-discovery:\n\nIf you don't use auto-discovery, add the below ServiceProvider to the `$providers` array in `config/app.php` file.\n\n```php\nAffordableMobiles\\EloquentDatastore\\DatastoreServiceProvider::class,\n```\n\n## Roadmap\n- [x] Read data using query builder.\n- [x] Read data using Eloquent model.\n- [x] Insert data using Eloquent model.\n- [x] Update data using Eloquent model.\n- [x] Delete data.\n- [x] Keys only queries.\n- [x] Auto-generated primary key.\n- [x] Read multiple pages of data with Datastore cursors.\n- [x] Batch update from Eloquent collection.\n- [ ] Cursor Paginate.\n- [x] Ancestor key relations.\n- [x] Datastore Namespaces (Multi-Tenancy).\n\n## Usage\n\nYou need to add `datastore` connection in `config/database.php` file.\n\n```php\n'connections' =\u003e [\n    ...\n    'datastore' =\u003e [\n        'driver' =\u003e 'datastore',\n        'transport' =\u003e env('DATASTORE_TRANSPORT', 'grpc'),\n    ],\n    ...\n],\n```\n\n### Access using Eloquent Model\n\nYou need to extend `AffordableMobiles\\EloquentDatastore\\Eloquent\\Model` class instead of Laravel's default Eloquent model class.\n\n**Example-**\n```php\n\u003c?php\n\nnamespace App\\Models;\n\nuse AffordableMobiles\\EloquentDatastore\\Eloquent\\Model;\n\nclass Project extends Model\n{\n    // Your works here\n}\n\n```\n\n### Access using Query Builder\n\n**Example-**\n```php\nDB::connection('datastore')\n    -\u003etable('projects')\n    -\u003ewhere('project_id', '\u003e', 5)\n    -\u003eskip(3)\n    -\u003etake(5)\n    -\u003eget();\n```\nIt will return a collection.\n\n## Tested Builder Functions\n- [x] `connection`\n- [x] `table`\n- [x] `from`\n- [x] `namespace` (Datastore Namespace: Multi Tenancy)\n- [x] `select` (for projection query)\n- [x] `kind` (same as table)\n- [x] `where` (Available:  = , \u003e , \u003c , \u003e= , \u003c= )\n- [x] `limit` / `take`\n- [x] `skip`\n- [x] `orderBy`\n- [x] `distinct`\n- [x] `get`\n- [x] `pluck`\n- [x] `exists`\n- [x] `count`\n- [ ] `simplePaginate`\n- [ ] `paginate` (works same as simplePaginate)\n- [x] `first`\n- [x] `delete`\n- [x] `insert`\n- [x] `_upsert` (different and incompatible with default `upsert`)\n- [x] `find` / `lookup`\n- [x] `chunk` / `chunkMap` / `each`\n- [x] `lazy` / `cursor`\n\n## Contribution Guide\n\nYou can contribute by reporting bugs, fixing bugs, submitting and reviewing pull requests.\n\nGo to **issues** section, and you can start working on an issue immediately.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faffordablemobiles%2Feloquent-datastore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faffordablemobiles%2Feloquent-datastore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faffordablemobiles%2Feloquent-datastore/lists"}