• Start

Libraries

/

Surqlize (ORM)

Overview

Surqlize is an object-relational mapper for SurrealDB in PHP, built on version 2 of the SDK, with attribute-driven models, a typed query builder, graph relations, and schema tooling.

Surqlize is an object-relational mapper for SurrealDB in PHP. You describe tables as PHP classes with attributes, then compose SurrealQL through a typed query builder instead of writing strings. It is built on top of version 2 of the SDK and uses the SDK to execute queries.

The core idea is small: describe your SurrealDB tables with models and attributes, then build queries through typed PHP APIs that your IDE and static analyser understand. Surqlize compiles each query to a deterministic SurrealQL string for tests, and runs it through the SDK with parameter-bound values at runtime.

Important

Surqlize is published as 0.0.1-alpha.2 and is in early development. It requires PHP 8.4 and depends on the alpha v2 SDK, so its API may change.

Was this page helpful?