• Start

v2 (alpha)

Overview

Version 2 of the SurrealDB SDK for PHP is a rewrite with a fluent query builder, typed credentials, and a PSR-based transport layer.

Version 2 is a rewrite of the PHP SDK. It keeps the same goal as v1, connecting your PHP application to SurrealDB, but changes most of the public surface. Queries are built with a fluent builder ($db->select($table)->where(...)->limit(10)), credentials are typed value objects, and the transport layer is built on PSR HTTP interfaces so you can swap in your own client.

Important

Version 2 is published as 2.0.0-alpha.1. It is an alpha with breaking changes against v1, and the public API may still change before a stable release. Pin the exact version when installing.

These docs are a work in progress. While the SDK is in alpha, expect them to change substantially as decisions about the public-facing API are settled.

The SDK requires PHP 8.4 or later and works with SurrealDB server versions 1.0.0 up to (but not including) 4.0.0. The version is checked on connect unless you disable it.

If you are upgrading an existing project, start with the migration guide.

Was this page helpful?