• Start

Languages

/

PHP

/

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.

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?