Version 1 is the current stable release of the PHP SDK. It exposes a single Surreal class with direct, RPC-style methods such as create(), select(), query(), and signin(). Each method maps closely to a SurrealDB RPC call.
The latest stable release is 2.0.0-alpha.3. A rewrite is available as v2 (alpha). If you are starting a new project and can accept alpha software, see the migration guide for the differences.
The SDK requires PHP 8.2 or later and the curl extension. It connects to a remote SurrealDB instance over HTTP or WebSocket.
Getting started
Concepts
Connecting to SurrealDB
Initialize the SDK, connect, and select a namespace and database.
Authentication
Sign up and sign in users with scopes, credentials, and tokens.
Executing queries
Run SurrealQL, call functions and keep variables on the connection.
Data manipulation
Select, create, insert, update, merge, patch and delete records.
Value types
How SurrealQL types map to PHP types and classes.
Import and export
Import a SurrealQL script into a database and export a database.