Each recipe in this section solves one application problem with a short schema, example data and the queries that do the work, tested against the current release of SurrealDB. Every recipe is based on an article, video or project from the SurrealDB community, and links back to it for the complete version.
Recipes
Invitation sign-in - a record access method that accepts an invitation code once, before it expires, and creates the account and team membership
Multi-tenant role-based access - tenants, roles and permissions as a graph, enforced by table permissions
An HTTP API in the database - a JSON task API served by
DEFINE API, with input checks and status codesProve a sports statistic - the youngest players to start a competitive game, from record links and a subquery per player
IoT telemetry with outlier alerts - readings stored by sensor and time, summarised over windows, with an event that raises alerts
Context for a recommendation prompt - purchases, returns, searches and a vector search, gathered for a language model in one query
For complete applications to clone and run, see the demos. For step-by-step guides, see the tutorials.