01 |ACCESS CONTROL
Identity and permissions, defined in the query language
Sign-up and sign-in logic, token verification, and per-row rules all live in your schema - versioned with your data and enforced by the engine on every query.
RECORD ACCESS
Users authenticate against your own tables
DEFINE ACCESS turns SurrealDB into a web database: users sign up and sign in against the records you already have, with password hashing built in.
ROW-LEVEL PERMISSIONS
Rules travel with the data
Permissions are declared on the table and enforced by the engine, so the same rule protects every query, live subscription, and API call - there is no application layer to forget it.
FIELD-LEVEL CONTROL
Validate and constrain every field
Type, assert, and default each field in the schema. Constraints run on write, so bad or unauthorised data never lands.
02 |ONE ENGINE
No separate auth service to run
Bolt-on auth means a second system to deploy, a second place for rules to drift, and a network hop on every check. In SurrealDB, identity and permissions are evaluated where the data lives.
One source of truth
Access rules live in the schema beside the data they protect, versioned together and impossible to bypass from another client.
Enforced in the transaction
Permissions are checked by the engine on every query, live subscription, and API call - not by application code you have to remember to write.
No extra hop
There is no auth server to call before the database call. The check and the query are the same operation.
GET STARTED
Build auth into your data, not beside it
Define access, permissions, and validation in SurrealQL and let the engine enforce them on every request.
SOC 2 Type 2
GDPR
Cyber Essentials Plus
ISO 27001