PHPackages                             savander/surrealdb-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. savander/surrealdb-client

ActiveLibrary[Database &amp; ORM](/categories/database)

savander/surrealdb-client
=========================

The client for SurrealDB database.

30[1 issues](https://github.com/savander/surrealdb-client/issues)PHP

Since Oct 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/savander/surrealdb-client)[ Packagist](https://packagist.org/packages/savander/surrealdb-client)[ RSS](/packages/savander-surrealdb-client/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SurealDB Client
===============

[](#surealdb-client)

> # ⚠️ Warning!
>
> [](#️-warning)
>
> The package is in the very early stages of development!

The client allows you to connect to SurrealDB and perform queries.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require savander/surrealdb-client
```

Usage
-----

[](#usage)

```
// The connection options.
$connectionOptions = (new ConnectionOptions())
    ->setNamespace('test')
    ->setDatabase('test')
    ->setUsername(getenv('DB_USER'))
    ->setPassword(getenv('DB_PASS'));

// The persistent connection to the SurrealDB Websocket server.
$connection = new Connection($connectionOptions);

// The results of the query. It returns the Johnny :)
$createdJohnny = $connection
    ->raw("CREATE author SET name.first = 'Johnny'")
    ->results();

// The results of the selection query, it returns the previously created Johnny.
//  > Please note that, we used `prepare` method here. It's much safer to do this that way.
//  > In this case, we are sending attributes as a separate array of arguments.
//  > You could use that method in previous step as well.
$selectedJohnny = $connection
    ->prepare('SELECT * FROM $author', ['author' => $createdJohnny['id']])
    ->results();
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b533e24656b7dd01986cb3ed0805dad6c6d97c5092fa308c2e7ad0024cb626e?d=identicon)[Savander](/maintainers/Savander)

---

Top Contributors

[![savander](https://avatars.githubusercontent.com/u/2012010?v=4)](https://github.com/savander "savander (20 commits)")

---

Tags

phpphp-clientphp8surrealdbsurrealdb-database

### Embed Badge

![Health badge](/badges/savander-surrealdb-client/health.svg)

```
[![Health](https://phpackages.com/badges/savander-surrealdb-client/health.svg)](https://phpackages.com/packages/savander-surrealdb-client)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
