xiaohongshu
xiaohongshu
gel
Gel (formerly EdgeDB) graph database schema design and querying. Use when designing Gel schemas, writing SDL, or querying with EdgeQL.
Full skill instructions
Gel is a graph-relational database (formerly EdgeDB, rebranded February 2025). It combines relational data modeling with graph database relationships and a powerful query language (EdgeQL).
Schema files use .esdl extension, typically in dbschema/default.esdl.
property or link keywords needed for non-computed fieldsname: str not name -> strlink keyword (prior to v4)type Person {
required name: str; # required property
email: str; # optional property
age: int16;
required employer: Company; # required link (single)
multi friends: Person; # multi link (many)
}
type User {
required email: str {
constraint exclusive; # unique
};
required username: str {
constraint exclusive;
constraint min_len_value(3);
};
}
scalar type Status extending enum<
pending, active, completed, cancelled
>;
type Task {
required status: Status {
default := Status.pending;
};
}
type Movie {
required title: str;
multi actors: Person;
}
type Person {
required name: str;
# Computed backlink - all movies where this person is an actor
multi link acted_in := .<actors[is Movie];
# Computed property
property movie_count := count(.acted_in);
}
Backlink syntax: .<link_name[is Type] returns all objects with a link named link_name pointing to current object.
Store metadata on the relationship itself, not the objects.
When to use: Best for many-to-many relationships where the link is a distinct concept with its own data.
Constraints: Link properties can only be primitive data (scalars, enums, arrays, tuples) - not links to other objects.
type Person {
required name: str;
multi friends: Person {
strength: int16; # how strong the friendship
since: datetime; # when friendship started
notes: str;
};
multi follows: Person {
followed_at: datetime {
default := datetime_of_statement();
};
};
}
Use @ prefix to access link properties:
select Person {
name,
friends: {
name,
@strength, # link property
@since
}
}
filter .name = 'Alice';
insert Person {
name := 'Alice',
friends := (
select Person { @strength := 10, @since := <datetime>'2020-01-01' }
filter .name = 'Bob'
)
};
Create polymorphic, tagged-union style data models.
Can't create instances directly - used to share structure.
abstract type HasTimestamps {
created_at: datetime {
default := datetime_current();
};
updated_at: datetime;
}
abstract type HasName {
required first_name: str;
required last_name: str;
property full_name := .first_name ++ ' ' ++ .last_name;
}
type Person extending HasTimestamps, HasName {
email: str;
}
abstract type Fact {
required message: Message;
label: str;
extracted_at: datetime {
default := datetime_current();
};
}
type TrackingFact extending Fact {
required tracking_number: str;
carrier: str;
}
type DateFact extending Fact {
required date_value: datetime;
date_type: str;
}
type AmountFact extending Fact {
required amount: decimal;
currency: str {
default := 'CAD';
};
}
# Query all facts, accessing subtype-specific properties
select Fact {
label,
extracted_at,
# Type-specific fields using [is SubType]
[is TrackingFact].tracking_number,
[is TrackingFact].carrier,
[is DateFact].date_value,
[is AmountFact].amount
};
# Filter by subtype
select TrackingFact {
tracking_number,
carrier
}
filter .carrier = 'UPS';
Links can target abstract types:
type Message {
required content: str;
multi facts: Fact; # can link to any Fact subtype
}
# Install Gel CLI
curl --proto '=https' --tlsv1.2 -sSf https://sh.geldata.com | sh
# Initialize project
gel project init
# Create migration after schema changes
gel migration create
# Apply migrations
gel migrate
# Interactive REPL
gel
# Generate TypeScript client
npx @gel/generate edgeql-js
project/
├── dbschema/
│ ├── default.esdl # Main schema
│ └── migrations/ # Auto-generated migrations
├── gel.toml # Project config
└── src/
└── dbschema/ # Generated TS client (if using)
abstract type HasTimestamps {
created_at: datetime {
default := datetime_current();
readonly := true;
};
updated_at: datetime {
rewrite insert, update using (datetime_current())
};
}
abstract type SoftDeletable {
deleted_at: datetime;
property is_deleted := exists .deleted_at;
}
type Item extending SoftDeletable {
required name: str;
}
type Category {
required name: str;
parent: Category;
multi link children := .<parent[is Category];
property depth := (
with recursive cat := .parent
select count(cat)
);
}
Research compiled 2026-01-11 from:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience