surrealdb-schema-design
Installation
SKILL.md
Apply the following schema design guidelines when working with SurrealDB.
Task: $ARGUMENTS
Core principle: choose the right relationship model
Indexed field (for ownership / simple filtering)
Use an indexed userId field when the query is a one-hop filter — "give me all records belonging to this user."
DEFINE FIELD userId ON item TYPE record<user>;
DEFINE INDEX idx_item_user ON item FIELDS userId;
SELECT * FROM item WHERE userId = user:123;