In Laravel you query SurrealDB three ways: through Surqlize models, through the raw SDK client, and through the SurrealDB manager facade. The integration registers the executor, so model queries work without passing one.
Model queries
Define Surqlize models and query them directly. They run through the Laravel-managed connection.
See Querying and Mutations for the full model API.
Raw SDK access
Resolve the SDK client for lower-level access.
The manager facade
The SurrealDB facade runs SurrealQL with lifecycle helpers around the same client, and targets a named connection with the connection: argument.
Transactions
The Surqlize facade runs a transaction over the executor. Run each query inside the callback through the transaction it passes you, with the executor: argument or withExecutor(). The transaction commits when the callback returns and rolls back if it throws.
Note
Learn more
Container and facades for the facade method reference
Surqlize transactions for the batching mechanism
Testing for asserting the queries your code sends