surrealdb

Explain SurrealDB SurrealQL syntax, schema definition, and Go SDK patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/raphi011/skills --skill surrealdb-raphi011
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: surrealdb
Source: https://github.com/raphi011/skills/tree/main/skills/surrealdb
Command: npx skills add https://github.com/raphi011/skills --skill surrealdb-raphi011

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides in-depth knowledge and practical solutions for working with SurrealDB, addressing complex queries, schema design, indexing strategies, and SDK usage.

Core Features & Use Cases

  • SurrealQL Optimization: Understand and avoid common pitfalls in SurrealQL queries, including UPSERT behavior, HNSW index limitations, and compound OR clauses.
  • Schema & Indexing: Learn best practices for defining schemas, HNSW and Fulltext indexes, and async events.
  • Go SDK Usage: Master transaction management, error handling, and connection best practices for the SurrealDB Go SDK.
  • Use Case: Debug a complex SurrealQL query that is unexpectedly failing due to a subtle parsing error or an incorrect index usage, and implement the correct pattern using the provided examples.

Quick Start

Use the surrealdb skill to explain the difference between UPSERT WHERE and CREATE/UPDATE patterns in SurrealDB.

Frequently Asked Questions about surrealdb

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

FAQPage Schema
How do I execute transactions and handle errors using the SurrealDB Go SDK?

To manage SurrealDB Go SDK transactions, you need to implement specific transaction patterns and robust error handling to ensure database consistency. This covers connection best practices and resolving common SDK pitfalls for reliable operations.

What is the correct way to use UPSERT WHERE compared to CREATE UPDATE in SurrealQL?

The UPSERT WHERE pattern in SurrealQL differs from CREATE UPDATE by conditionally updating existing records or creating new ones without throwing errors. Understanding this distinction avoids subtle parsing errors during complex query execution.

How do I define HNSW and Fulltext indexing in a SurrealDB schema?

Defining HNSW and Fulltext indexes in a SurrealDB schema requires specific syntax to optimize vector and text search performance. Proper schema design ensures async events and indexing strategies function correctly across versions.

Why does my SurrealQL query fail with compound OR clauses or incorrect index usage?

SurrealQL queries fail with compound OR clauses or incorrect index usage due to subtle parsing errors and known HNSW index limitations. Debugging requires identifying these specific gotchas and applying correct query patterns.

Does this guidance cover breaking changes and common gotchas across SurrealDB versions?

Yes, this guidance addresses common gotchas and breaking changes across SurrealDB versions, focusing on practical application and performance optimization. It helps navigate unexpected failures in syntax, schema definition, and SDK behavior.