{"id":36266012,"url":"https://github.com/daumling/php-dataset","last_synced_at":"2026-01-11T08:03:39.073Z","repository":{"id":56963104,"uuid":"260638255","full_name":"daumling/php-dataset","owner":"daumling","description":"A JSON-based, SQL-like manipulation of structured data","archived":false,"fork":false,"pushed_at":"2020-05-04T13:24:14.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T04:36:11.539Z","etag":null,"topics":["dataset","json","php","sql"],"latest_commit_sha":null,"homepage":"https://daumling.github.io/php-dataset/","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/daumling.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":"2020-05-02T07:42:31.000Z","updated_at":"2020-05-04T13:23:25.000Z","dependencies_parsed_at":"2022-08-21T08:20:49.104Z","dependency_job_id":null,"html_url":"https://github.com/daumling/php-dataset","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/daumling/php-dataset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daumling%2Fphp-dataset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daumling%2Fphp-dataset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daumling%2Fphp-dataset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daumling%2Fphp-dataset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daumling","download_url":"https://codeload.github.com/daumling/php-dataset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daumling%2Fphp-dataset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28297983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dataset","json","php","sql"],"created_at":"2026-01-11T08:03:38.254Z","updated_at":"2026-01-11T08:03:39.068Z","avatar_url":"https://github.com/daumling.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-datasets\n\n**See the entire documentation at https://daumling.github.io/php-dataset/**!\n\nI was looking for a simple way to manipulate complex PHP data structures. A quick research found a few solutions, which all fell short in some way.\n\nThe Dataset object takes an associative array, whose members are either arrays or objects. It provides SQL-like calls to search and manipulate data, and offers JSON files as a storage medium. Other storage solutions can be added easily with subclassing.\n\nThis Dataset implementation offers\n\n  * Easy handling of JSON data\n  * multiple search possibilities, including regular expressions\n  * hiding the differences between PHP arrays and objects\n  * multiple storage backends\n\nEach search operation returns a new Dataset containing the results of the search only. The data of these child datasets is always stored by reference, which saves memory and makes updates easy. Of course, accidential updates may go unnoticed, so this concept needs to be used with caution.\n\nAlmost all Dataset methods return a Dataset instance, either a new dataset, or the dataset itself, so calls can be chained easily. Datasets containing intermediate results may be saved for later use.\n\nHere is an example. Assuming a JSON database of persons with the following example record:\n```json\n{\n    \"name\" : \"John Smith\",\n    \"age\": 44,\n    \"address\" : {\n        ...\n        \"state\" : \"CA\"\n    }\n}\n```\nYou can easily iterate over, say, retired persons with an age of 65 or more:\n\n```php\nforeach ($file-\u003ewhere('age', '\u003e=', 65)-\u003efetch() as $record) ...\n```\nOr if you only need NY retirees:\n```php\nforeach ($file-\u003ewhere('age', '\u003e=', 65)-\u003ewhere('address.state' '=', 'NY')-\u003efetch() as $record) ...\n```\n\n## Installation\n\nThe easiest way to install and use Datasets is `composer`:\n\n  `composer require daumling/php-dataset`\n\nYour PHP file could look like this:\n\n```php\nrequire_once __DIR__.'/vendor/autoload.php';\nuse \\Daumling\\Dataset\\File as DB;\n\n// set the path\nDB::setOptions([\n    'path' =\u003e __DIR__.'/data/*.json'\n]);\n// Open data/addresses.json\n$file = DB::get('addresses');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaumling%2Fphp-dataset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaumling%2Fphp-dataset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaumling%2Fphp-dataset/lists"}