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
Getting started
Installation
Install Surqlize with Composer and the alpha SDK it depends on.
Models
Describe tables as PHP classes with attribute-driven fields.
Connections
Register an SDK executor and inject one per query when needed.
Building queries
Querying
Typed select, where, ordering, projections, and the execution methods.
Mutations
Create, update, upsert, and delete with model helpers and builders.
Edges and graph
Edge models, graph traversal, and RELATE.
Search, vector, and geometry
Full-text search, vector KNN, and geometry helpers.
Schema and tooling
Schema
Define tables with a schema contract or the fluent DSL.
Code generation and CLI
Generate typed field adapters and run the CLI commands.
Transactions
Batch ORM queries into a single transaction with rollback.
Sources
PHP SDK v2 that Surqlize builds on
Laravel integration for using Surqlize in Laravel