surrealdb-expert

Design SurrealDB schemas with permissions, row-level security, and indexing.

2|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/twarogowski/trauma2 --skill surrealdb-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: surrealdb-expert
Source: https://github.com/twarogowski/trauma2/tree/main/.claude/skills/surrealdb-expert
Command: npx skills add https://github.com/twarogowski/trauma2 --skill surrealdb-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SurrealDB Expert helps teams design secure, scalable multi-model schemas and efficient queries, reducing security risks and development time by providing best-practice patterns.

Core Features & Use Cases

  • Graph and document modeling with typed edges, and efficient traversal strategies for SurrealDB.
  • Security-by-default: explicit PERMISSIONS, row-level security, and RBAC to enforce least privilege.
  • Real-time patterns: LIVE queries and subscriptions with proper cleanup and monitoring.
  • Performance optimization: indexing strategies, FETCH usage to avoid N+1, and optimized graph traversals.
  • Use Case: Architect a multi-tenant application with secure data access, audit trails, and responsive real-time dashboards.

Quick Start

Start by outlining a SurrealDB schema for a sample domain (e.g., users, posts, and comments) with a typed relationship edge, apply row-level security, and add relevant indexes. Then refine the model to support RBAC roles and live subscription needs.

Frequently Asked Questions about surrealdb-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement row-level security and RBAC in SurrealDB?

To implement row-level security and RBAC in SurrealDB, define explicit PERMISSIONS within your SCHEMAFULL table definitions. This enforces least privilege access by restricting data visibility based on assigned user roles and parameterized query conditions.

What is the best way to model graph and document schemas in SurrealDB?

Modeling graph and document schemas in SurrealDB involves combining typed relationship edges with document records. You define SCHEMAFULL tables for nodes and edges, apply indexing strategies, and use optimized graph traversal queries for efficient data retrieval.

How do I set up live queries and real-time subscriptions in SurrealDB?

Live queries and real-time subscriptions in SurrealDB are set up using the LIVE query feature to push updates to connected clients. You establish subscriptions with proper cleanup patterns and monitoring to maintain responsive real-time dashboards.

How do I avoid N+1 query problems and optimize performance in SurrealDB?

Avoid N+1 query problems and optimize SurrealDB performance by using the FETCH clause to eager-load related graph edges and document records. Combine this with proper indexing strategies and optimized graph traversals to reduce query overhead.

Can I architect a multi-tenant application using SurrealDB with secure data access?

You can architect a multi-tenant application in SurrealDB by combining SCHEMAFULL definitions, RBAC, and row-level security. This approach isolates tenant data through explicit PERMISSIONS while supporting audit trails and real-time live query dashboards.