Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

solidb

БесплатноЗапускает вложенные скриптыНе проверен

Use when working with SoliDB (the Soli framework's document database) — writing or debugging SDBQL queries (its AQL-like FOR/FILTER/RETURN language), `@sdbql{…

solisoftот solisoft★ 20 звёзд на GitHub

Об этом скилле

SoliDB and SDBQL

SoliDB is a document database (Rust; a new data directory is stored on solistore since 2.15.0, on RocksDB through 2.14.0, and an existing one keeps its engine) that speaks HTTP/JSON (plus a binary MessagePack driver protocol on the same port). Queries are written in SDBQL, an ArangoDB-AQL-style language: FOR … FILTER … SORT … LIMIT … RETURN. The Soli framework's Model ORM compiles to SDBQL.

Everything below was checked against solidb 2.4.0 and Soli 2.28.2 (Soli-side statements reviewed against Soli 2.36.3's changelog, not re-run). Where a claim could not be checked it says (unverified).

Core concepts

  • Database → collections → documents. A server holds databases (_system always exists). A collection holds JSON documents. Collection types: document (default), edge (requires _from/_to), blob.
  • System fields, added by the server on every write:
    • _key — the primary key, unique in its collection. Generated as a UUIDv7 string if you don't give one ("01a1682c-4ade-78e0-…"). Any string is accepted (even "bad key!").
    • _id — "<database>:<collection>/<key>", e.g. "shop:users/alice". Not users/alice as in ArangoDB. FILTER u._id == "users/alice" matches nothing; filter on _key instead.
    • _rev — a UUID that changes on every write (used for If-Match CAS).
    • _created_at, _updated_at — RFC 3339 strings.
    • _id/_rev you supply on insert are overwritten.
  • Edges reference vertices as "collection/key" (_from: "users/alice"); traversal and DOCUMENT("users/alice") accept that short form.
  • Auth: every /_api/* call needs Authorization: Bearer <jwt> (from POST /auth/login), HTTP Basic (-u user:pass), or X-API-Key: <key>. GET /_api/health is open.

SDBQL essentials

-- comments start with -- (NOT // or /* */ — those are parse errors)
FOR u IN users                         -- collection, array, range (1..10), or subquery
  FILTER u.age >= @min AND u.active    -- several FILTERs are ANDed
  LET posts = (FOR p IN posts FILTER p.user_id == u._key RETURN p)
  SORT u.age DESC, u.name ASC
  LIMIT 20, 10                         -- offset, count  (or LIMIT count)
  RETURN { name: u.name, n: LENGTH(posts) }
  • Keywords are case-insensitive; function names are upper-case by convention.
  • Since 3.1.0 (observed 2026-11-24/25 on builds of the tree released as 3.1.0): EXPLAIN <query> returns one plan row and does not write; EXPLAIN ANALYZE of a write does write, once, and returns the plan without timings. QUALIFY <window-predicate> filters after the body and before SORT (windows numbered on the full set). FOR d IN c SAMPLE n / SAMPLE p PERCENT samples the source before FILTER and reads all of it. COLLECT a = …, b = … ROLLUP|CUBE AGGREGATE … adds subtotals; GROUPING(a) is 1 where a was rolled up. Full rules: references/sdbql.md.
  • Strings take "…" or '…'. Object keys: bare, quoted ({"b-c": 1}), or shorthand {name}. Computed keys {[k]: 1} are not supported.
  • LET may come after SORT/LIMIT — then it runs only for surviving rows.
  • RETURN DISTINCT expr; x[*].field projects over an array; a[-1] is the last element; 1..3 is an inclusive range [1,2,3].
  • Operators: == != < <= > >=, IN, NOT IN, LIKE (%, _, case-sensitive), =~ / !~ regex, AND OR NOT / && || !, ? :, ?? (null fallback), ?. (null-safe access), |> (pipe into a function's first argument), CASE WHEN … THEN … ELSE … END.
  • null || "x" → "x" but null OR "x" → true (|| returns a value).
  • Quantifiers: FILTER ANY t IN u.tags SATISFIES t == "x" and NONE … SATISFIES work; ALL … SATISFIES does not parse — use EVERY(u.tags, t -> t == "x").
  • Lambdas: MAP(xs, x -> x * 2), FILTER(xs, x -> x > 1), REDUCE(xs, (acc, x) -> acc + x, 0), SORT_BY, GROUP_BY, EVERY, SOME.
  • Read one document: DOCUMENT("users/alice") or DOCUMENT("users", "alice") (returns null when missing).

Grouping

FOR o IN orders
  COLLECT country = o.country                    -- group key(s)
  AGGREGATE total = SUM(o.amount), n = COUNT()   -- per-group aggregates
  FILTER total > 100                             -- post-COLLECT filter
  SORT total DESC
  RETURN { country, total, n }

FOR o IN orders COLLECT s = o.status WITH COUNT INTO n RETURN { s, n }
FOR o IN orders COLLECT s = o.status INTO g RETURN { s, keys: g[*].o._key }
FOR o IN orders COLLECT s = o.status INTO keys = o._key RETURN { s, keys }
FOR o IN orders COLLECT AGGREGATE total = SUM(o.amount) RETURN total  -- no key

-- Since 3.1.0. Subtotals; GROUPING is 1 on a rolled-up key.
FOR o IN orders
  COLLECT country = o.country, status = o.status ROLLUP
  AGGREGATE total = SUM(o.amount)
  RETURN { country, status, total, rolled: GROUPING(status) }

Window functions work in RETURN, in a LET and, since 3.1.0, in QUALIFY (the predicat

Полный SKILL.md на GitHub

Установить solidb в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/functions.mdreferences/http-api.mdreferences/indexes-search.mdreferences/orm-mapping.mdreferences/sdbql.mdreferences/traps.mdscripts/sdbql.sh

FAQ

Что делает скилл solidb?

Use when working with SoliDB (the Soli framework's document database) — writing or debugging SDBQL queries (its AQL-like FOR/FILTER/RETURN language), `@sdbql{ … }` blocks, `db.query(...)` / the `Solidb` client, `Model.where("doc.… == @x", binds)` strings, Soli model queries that need raw SDBQL (window functions, graph traversal, UPSERT, bulk writes), reading `.to_query` / `dev_queries()` output, or calling the SoliDB HTTP API (`/auth/login`, `/_api/database/{db}/cursor`, collections, documents, indexes, transactions). Also for running a throwaway `solidb` instance to test queries.

Как установить скилл solidb?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл solidb запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить solidb с