{"id":21557069,"url":"https://github.com/savander/surrealdb-client","last_synced_at":"2026-04-19T03:03:21.990Z","repository":{"id":60528833,"uuid":"538981805","full_name":"savander/surrealdb-client","owner":"savander","description":"The client for SurrealDB database.","archived":false,"fork":false,"pushed_at":"2022-10-03T18:22:37.000Z","size":33,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T12:34:27.215Z","etag":null,"topics":["php","php-client","php8","surrealdb","surrealdb-database"],"latest_commit_sha":null,"homepage":"","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/savander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-20T12:39:04.000Z","updated_at":"2023-01-06T17:06:15.000Z","dependencies_parsed_at":"2022-09-30T22:10:17.881Z","dependency_job_id":null,"html_url":"https://github.com/savander/surrealdb-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/savander/surrealdb-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savander%2Fsurrealdb-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savander%2Fsurrealdb-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savander%2Fsurrealdb-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savander%2Fsurrealdb-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savander","download_url":"https://codeload.github.com/savander/surrealdb-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savander%2Fsurrealdb-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31992822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["php","php-client","php8","surrealdb","surrealdb-database"],"created_at":"2024-11-24T08:10:51.379Z","updated_at":"2026-04-19T03:03:21.973Z","avatar_url":"https://github.com/savander.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SurealDB Client\n\n\u003c!--\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/savander/surrealdb-client.svg?style=flat-square)](https://packagist.org/packages/savander/surrealdb-client)\n[![Total Downloads](https://img.shields.io/packagist/dt/savander/surrealdb-client.svg?style=flat-square)](https://packagist.org/packages/savander/surrealdb-client)\n![GitHub Actions](https://github.com/savander/surrealdb-client/actions/workflows/main.yml/badge.svg)\n--\u003e\n\n\u003e # ⚠️ Warning! \n\u003e The package is in the very early stages of development!\n\n\u003cbr\u003e\n\nThe client allows you to connect to SurrealDB and perform queries.\n\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require savander/surrealdb-client\n```\n\n## Usage\n\n```php\n// The connection options.\n$connectionOptions = (new ConnectionOptions())\n    -\u003esetNamespace('test')\n    -\u003esetDatabase('test')\n    -\u003esetUsername(getenv('DB_USER'))\n    -\u003esetPassword(getenv('DB_PASS'));\n\n// The persistent connection to the SurrealDB Websocket server.\n$connection = new Connection($connectionOptions);\n\n// The results of the query. It returns the Johnny :)\n$createdJohnny = $connection\n    -\u003eraw(\"CREATE author SET name.first = 'Johnny'\")\n    -\u003eresults();\n\n// The results of the selection query, it returns the previously created Johnny.\n//  \u003e Please note that, we used `prepare` method here. It's much safer to do this that way.\n//  \u003e In this case, we are sending attributes as a separate array of arguments.\n//  \u003e You could use that method in previous step as well.\n$selectedJohnny = $connection\n    -\u003eprepare('SELECT * FROM $author', ['author' =\u003e $createdJohnny['id']])\n    -\u003eresults();\n```\n\n\u003c!--\n### Testing\n\n```bash\ncomposer test\n```\n--\u003e\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavander%2Fsurrealdb-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavander%2Fsurrealdb-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavander%2Fsurrealdb-client/lists"}