SurrealDB Operations & Code Standards

Official

Standardize SurrealDB ops for safe, reliable apps

AuthorHNULS-LabHub
Version1.0.0
Installs0

System Documentation

What problem does it solve?

规范所有 SurrealDB 相关操作的编写方式,涵盖实例管理、查询模式、错误处理、并发安全、跨库查询、日志规范和类型安全。基于 KnowledgeDatabase 项目重构中总结的实战教训,防止"查询静默失败"、"并发串库"、"重复实例"三大顽疾。适用于 Main Process、Utility Process 及 SharedUtils 中所有与 SurrealDB 交互的代码。

Core Features & Use Cases

  • 单例化管理 SurrealDB 实例与查询服务,确保生命周期清晰且可注入
  • 参数化查询、类型安全与错误处理的统一实现,避免注入风险与静默失败
  • 并发安全与跨库查询保护,防止并发串库和数据不一致
  • 日志规范与跨项目复用,提供可追溯的操作日志和统一错误类型
  • 适用于 Main Process、Utility Process 及 SharedUtils 的 SurrealDB 交互代码

Quick Start

Follow the injection order to initialize SurrealDB services and inject the QueryService before exposing database operations.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: SurrealDB Operations & Code Standards
Download link: https://github.com/HNULS-LabHub/HNULS-KnowledgeDatabase/archive/main.zip#surrealdb-operations-code-standards

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.