Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 14, 2026·3 min de lectura

EdgeDB (Gel) — The Next-Generation Graph-Relational Database

EdgeDB (now rebranded as Gel) is a relational database built on PostgreSQL with a richer type system, EdgeQL query language, and first-class support for links between objects. It eliminates ORM boilerplate and N+1 queries by design.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
step-1.md
Comando con revisión previa
npx -y tokrepo@latest install 0945307b-37d2-11f1-9bc6-00163e2b0d79 --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

TL;DR
EdgeDB combines relational reliability with graph-style object links and EdgeQL, eliminating ORMs and N+1 queries by design.
§01

What it is

EdgeDB (recently rebranded as Gel) is an open-source database built on top of PostgreSQL. It replaces SQL with EdgeQL, a query language designed for deep nested fetches and graph traversals. Objects in EdgeDB have typed properties and first-class links to other objects, so relationships are part of the schema rather than join tables.

EdgeDB targets backend developers who are tired of ORM boilerplate and N+1 query problems. Because links are resolved at the query engine level, a single EdgeQL query can fetch deeply nested object graphs without manual joins.

§02

How it saves time or tokens

EdgeDB eliminates the mapping layer between your application and database. Instead of writing SQL queries, ORM models, and serialization logic, you define a declarative schema and write EdgeQL queries that return exactly the shape of data your application needs. This means fewer lines of code to maintain and fewer opportunities for N+1 query bugs.

The built-in migration system auto-generates migrations from schema changes, so you never write migration files by hand. Run edgedb migration create and the CLI diffs your schema and produces the migration.

§03

How to use

  1. Install the CLI: curl --proto '=https' --tlsv1.2 -sSf https://sh.edgedb.com | sh.
  2. Initialize a project with edgedb project init, which creates a local instance and schema file.
  3. Define your schema in dbschema/default.esdl, create migrations with edgedb migration create, and apply them with edgedb migrate.
§04

Example

# dbschema/default.esdl
module default {
  type User {
    required name: str;
    required email: str {
      constraint exclusive;
    };
    multi posts := .<author[is Post];
  }
  type Post {
    required title: str;
    required body: str;
    required author: User;
    created_at: datetime {
      default := datetime_current();
    };
  }
}
# Fetch users with their posts in one query - no N+1
select User {
  name,
  email,
  posts: { title, created_at }
} filter .name = 'Alice';
§05

Related on TokRepo

§06

Common pitfalls

  • EdgeDB runs on PostgreSQL under the hood but does not expose raw SQL access; if your workflow depends on PostgreSQL-specific extensions (PostGIS, pg_trgm), verify EdgeDB compatibility first.
  • The EdgeQL learning curve is real for developers coming from SQL; invest time with the interactive tutorial before building production schemas.
  • Self-hosted EdgeDB requires managing a PostgreSQL instance underneath; for simpler deployments, consider EdgeDB Cloud.

Preguntas frecuentes

Is EdgeDB a replacement for PostgreSQL?+

EdgeDB is built on top of PostgreSQL and uses it as its storage engine. It replaces the SQL interface with EdgeQL and adds a richer type system, but PostgreSQL handles the actual data storage and ACID transactions underneath.

What happened with the Gel rebrand?+

EdgeDB rebranded to Gel while maintaining the same technology and codebase. The CLI tools and query language remain the same. Both names may appear in documentation during the transition period.

Does EdgeDB support migrations?+

Yes. EdgeDB has a built-in migration system. When you modify your schema file, run edgedb migration create and the CLI automatically generates the migration by diffing the current and desired schema states.

Can I use EdgeDB with TypeScript?+

Yes. EdgeDB provides an official TypeScript client with full type safety. The edgeql-js query builder generates TypeScript types from your schema, giving you compile-time validation of all queries.

How does EdgeDB handle N+1 queries?+

EdgeDB resolves object links at the query engine level. A single EdgeQL query can fetch nested objects to arbitrary depth in one round trip, eliminating the N+1 problem that plagues ORMs and manual SQL joins.

Referencias (3)

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados