技能详情(站内镜像,无评论)
许可证:MIT-0
MIT-0 ·免费使用、修改和重新分发。无需归因。
版本:v1.2.1
统计:⭐ 2 · 440 · 0 current installs · 0 all-time installs
⭐ 2
安装量(当前) 0
🛡 VirusTotal :良性 · OpenClaw :良性
Package:24601/surrealism
安全扫描(ClawHub)
- VirusTotal :良性
- OpenClaw :良性
OpenClaw 评估
The skill is an instruction-only walkthrough for writing and deploying SurrealDB WASM extensions with Rust; its instructions and requirements are coherent with that purpose and it does not request unexpected credentials or install arbitrary code.
目的
Name and description match the SKILL.md content: it documents writing Rust functions, compiling to WASM, and registering modules in SurrealDB. The prerequisites mentioned (Rust toolchain, WASM target, SurrealDB CLI) are appropriate and expected for this functionality.
说明范围
Instructions are narrowly scoped to project files, building a WASM binary, and running SurrealDB CLI commands to register modules. The example shows using database credentials on the CLI (e.g., --user root --pass root) — this is relevant to registering modules but users should avoid using high-privilege credentials in production and be cautious about running or registering untrusted WASM modules.
安装机制
No install spec or downloadable artifacts are present; the skill is instruction-only and does not cause any code to be fetched or written by the registry installer. This is the lowest-risk install footprint.
证书
The skill declares no required environment variables or secrets, and the only credentials referenced appear in a CLI example to access SurrealDB. Requesting DB credentials (for registering modules) is proportionate to the task; however the skill itself does not require or store them.
持久
always is false and the skill is user-invocable; it does not request persistent agent privileges or modify other skill configurations. Autonomous invocation is allowed by platform defaults but is not a special privilege granted by this skill.
综合结论
This skill is an instructional guide for building SurrealDB WASM extensions and appears internally consistent. Before using it: (1) only compile and deploy WASM modules from code you trust — WASM can execute arbitrary logic in your DB process; (2) avoid using high-privilege (root) DB credentials shown in examples; use least privilege and separate test environments; (3) install Rust and the SurrealDB CLI from official sources; (4) when register…
安装(复制给龙虾 AI)
将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。
请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「surrealism」。简介:SurrealDB Surrealism WASM extension development. Write Rust functions, compile …。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/24601/surrealism/SKILL.md
(来源:yingzhi8.cn 技能库)
SKILL.md
---
name: surrealism
description: "SurrealDB Surrealism WASM extension development. Write Rust functions, compile to WASM, deploy as database modules. Part of the surreal-skills collection."
license: MIT
metadata:
version: "1.0.4"
author: "24601"
parent_skill: "surrealdb"
snapshot_date: "2026-02-19"
upstream:
repo: "surrealdb/surrealdb"
release: "v3.0.0"
sha: "2e0a61fd4daf"
docs: "https://surrealdb.com/docs/surrealdb/extensions"
---
# Surrealism -- WASM Extensions for SurrealDB
New in SurrealDB 3. Write custom functions in Rust, compile them to WebAssembly
(WASM), and deploy them as native database modules callable from SurrealQL.
## Prerequisites
- Rust toolchain (stable) with `wasm32-unknown-unknown` target
- SurrealDB CLI v3.0.0+ (`surreal` binary with `surreal module` subcommand)
- Familiarity with SurrealQL `DEFINE MODULE` and `DEFINE BUCKET`
## Development Workflow
```
1. Annotate -- surrealism.toml + #[surrealism] on Rust functions
2. Compile -- surreal module compile (produces .wasm binary)
3. Register -- DEFINE BUCKET + DEFINE MODULE in SurrealQL
```
## Quick Start
```bash
# Create a new Surrealism project
cargo new --lib my_extension
cd my_extension
# Add the WASM target
rustup target add wasm32-unknown-unknown
# Create surrealism.toml (required manifest)
cat > surrealism.toml << 'TOML'
[package]
name = "my_extension"
version = "0.1.0"
TOML
# Write your extension (annotate with #[surrealism])
cat > src/lib.rs << 'RUST'
use surrealism::surrealism;
#[surrealism]
fn greet(name: String) -> String {
format!("Hello, {}!", name)
}
RUST
# Compile to WASM using SurrealDB CLI
surreal module compile
# Register in SurrealDB
surreal sql --endpoint http://localhost:8000 --user root --pass root --ns test --db test
```
```surql
-- Grant access to the WASM file
DEFINE BUCKET my_bucket;
-- Register the module functions
DEFINE MODULE my_extension FROM 'my_bucket:my_extension.wasm';
-- Use the function in queries
SELECT my_extension::greet('World');
```
## Use Cases
- Custom scalar functions callable from SurrealQL
- Fake/mock data generation for testing
- Domain-specific logic (language processing, quantitative finance, custom encoding)
- Access to niche Rust crate functionality too specific for core SurrealDB
- Custom analyzers for full-text search
## Status
Surrealism is actively in development and not yet stable. The API may change
between SurrealDB 3.x releases. File feedback via GitHub issues/PRs on the
[surrealdb/surrealdb](https://github.com/surrealdb/surrealdb) repository.
## Full Documentation
See the main skill's rule file for complete guidance:
- **[rules/surrealism.md](../../rules/surrealism.md)** -- project setup, Rust function signatures, WASM compilation, DEFINE MODULE/BUCKET syntax, deployment, testing, and best practices
- **[SurrealDB Extensions Docs](https://surrealdb.com/docs/surrealdb/extensions)** -- official documentation
- **[CLI module command](https://surrealdb.com/docs/surrealdb/cli/module)** -- `surreal module` reference