> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Surqlize

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](https://github.com/surrealdb/surqlize.php) 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](/docs/reference/php/v2.md) and uses the SDK to execute queries.

Models and attributes describe your SurrealDB tables, and queries are built 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](/docs/reference/php/v2.md), so its API may change.

## Getting started

- [Installation](/docs/libraries/surqlize-php/installation.md) - Install Surqlize with Composer and the alpha SDK it depends on.

- [Models](/docs/libraries/surqlize-php/models.md) - Describe tables as PHP classes with attribute-driven fields.

- [Connections](/docs/libraries/surqlize-php/connections.md) - Register an SDK executor and inject one per query when needed.

## Building queries

- [Querying](/docs/libraries/surqlize-php/querying.md) - Typed select, where, ordering, projections, and the execution methods.

- [Mutations](/docs/libraries/surqlize-php/mutations.md) - Create, update, upsert, and delete with model helpers and builders.

- [Edges and graph](/docs/libraries/surqlize-php/edges-and-graph.md) - Edge models, graph traversal, and RELATE.

- [Search, vector, and geometry](/docs/libraries/surqlize-php/search-vector-geometry.md) - Full-text search, vector KNN, and geometry helpers.

## Schema and tooling

- [Schema](/docs/libraries/surqlize-php/schema.md) - Define tables with a schema contract or the fluent DSL.

- [Code generation and CLI](/docs/libraries/surqlize-php/code-generation-and-cli.md) - Generate typed field adapters and run the CLI commands.

- [Transactions](/docs/libraries/surqlize-php/transactions.md) - Batch ORM queries into a single transaction with rollback.

## Sources

- [GitHub repository](https://github.com/surrealdb/surqlize.php)
- [PHP SDK v2](/docs/reference/php/v2.md) that Surqlize builds on
- [Laravel integration](/docs/reference/php/frameworks/laravel.md) for using Surqlize in Laravel
