# 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. ## Install Save in your project root: # EdgeDB (Gel) — Graph-Relational Database ## Quick Use ```bash # Install CLI (macOS/Linux) curl --proto "=https" --tlsv1.2 -sSf https://sh.edgedb.com | sh # Initialize a project (creates local instance + schema file) edgedb project init # Apply schema edgedb migration create edgedb migrate ``` ```esdl # dbschema/default.esdl — schema file module default { type User { required name: str; required email: str { constraint exclusive; }; multi posts := . '2026-01-01T00:00:00Z'; ``` ## Introduction EdgeDB (branded as Gel in 2025) is built by two core Python contributors and aims to fix what decades of ORMs and SQL have avoided: the object-relational mismatch. It runs on top of Postgres but exposes an object-oriented schema (types, links, computed properties) and a purpose-built query language (EdgeQL) that makes relational work feel natural. With over 14,000 GitHub stars, EdgeDB is attracting attention from developers tired of writing ORM models and manually joining rows. Native clients exist for TypeScript, Python, Go, and Rust. ## What EdgeDB Does Schemas are object types with properties and **links** (typed edges to other objects). The compiler turns these into a Postgres schema under the hood. EdgeQL queries are composable (return shaped JSON directly), type-safe (client codegen), and support computed properties, polymorphism, and access policies. ## Architecture Overview ``` [EdgeDB Server] Query compiler: EdgeQL -> SQL Migration engine Built-in connection pool Authentication + access policies | [PostgreSQL] (embedded, managed by EdgeDB) | [EdgeQL Features] shaped results (nested JSON out of the box) implicit joins via links computed properties constraints + indexes access policies (row-level security, natively) | [Client Bindings] TypeScript (typed query builder), Python, Go, Rust, Elixir ``` ## Self-Hosting & Configuration ```typescript // TypeScript client with codegen import { createClient } from "edgedb"; import e from "./dbschema/edgeql-js"; // generated query builder const client = createClient(); const query = e.select(e.User, (u) => ({ name: true, email: true, posts: (p) => ({ title: true, created: true, filter: e.op(p.created, ">", e.cast(e.datetime, "2026-01-01T00:00:00Z")), order_by: p.created, }), filter_single: { email: "alice@example.com" }, })); const result = await query.run(client); // result is fully typed — no manual DTOs, no runtime guessing ``` ```esdl # Access policy: users can only read their own posts type Post { required title: str; required author: User; access policy author_only allow select using (.author = global current_user); } ``` ## Key Features - **EdgeQL** — composable, typed, shape-aware query language - **Links (not FKs)** — typed relationships, zero JOIN boilerplate - **Schema migrations** — version controlled, auto-generated - **Access policies** — row-level security in schema - **Typed clients** — TypeScript codegen returns typed results - **Postgres inside** — mature storage engine; Postgres features available via escape hatches - **HTTP + GraphQL protocols** — optional, talk EdgeDB from anywhere - **Gel rebrand** — same project, new name + sharper branding in 2025 ## Comparison with Similar Tools | Feature | EdgeDB / Gel | PostgreSQL + ORM | Prisma | Hasura | SurrealDB | |---|---|---|---|---|---| | Core storage | Postgres | Postgres | Any | Postgres | Custom | | Query language | EdgeQL | SQL + ORM DSL | Prisma Client | GraphQL | SurrealQL | | Schema model | Object types + links | Tables + FKs | Prisma models | Postgres schema | Multi-model | | Type safety | Native codegen | ORM-dependent | Excellent | GraphQL codegen | Strong | | Migrations | Built-in, auto | ORM migrations | Prisma Migrate | Hasura migrations | Manual | | Access policies | First-class | RLS manual | Via middleware | Built-in | Built-in | | Best For | Greenfield apps + TypeScript | Ubiquitous Postgres | Node + Prisma shops | GraphQL-first | Multi-model greenfield | ## FAQ **Q: EdgeDB vs Prisma?** A: Prisma is an ORM over your chosen database. EdgeDB is a database with a native typed query language. EdgeDB avoids the ORM-SQL impedance mismatch entirely; Prisma works with any Postgres/MySQL. **Q: Why the rebrand to Gel?** A: The team renamed the product to "Gel" in 2025 for a sharper brand identity. The GitHub repo is `geldata/gel` (formerly `edgedb/edgedb`). Core functionality is unchanged. **Q: Is EdgeDB production-ready?** A: Yes. Multiple startups ship EdgeDB in production. For conservative stacks, vanilla Postgres remains the safer default — but EdgeDB has proven mature for greenfield TypeScript/Python teams. **Q: Can I use vanilla Postgres features?** A: Yes via escape hatches. EdgeDB stores data in Postgres, so you can run SQL directly for advanced needs (at the cost of bypassing EdgeDB safety checks). ## Sources - GitHub: https://github.com/geldata/gel (formerly edgedb/edgedb) - Docs: https://geldata.com - Company: Gel (formerly EdgeDB Inc.) - License: Apache-2.0 --- Source: https://tokrepo.com/en/workflows/0945307b-37d2-11f1-9bc6-00163e2b0d79 Author: AI Open Source