DEV Community

Alex Spinov
Alex Spinov

Posted on

EdgeDB Has a Free API — The Post-Relational Database

EdgeDB is a next-generation database that fixes SQL frustrations. It provides a modern query language (EdgeQL), built-in migrations, and a type-safe schema.

What Is EdgeDB?

EdgeDB is built on top of PostgreSQL but replaces SQL with EdgeQL — a more intuitive, composable query language. It handles relations, constraints, and computed properties natively.

Free tier (EdgeDB Cloud):

  • 1 instance
  • 1GB storage
  • Generous compute

Quick Start

curl --proto "=https" -sSf https://sh.edgedb.com | sh
edgedb project init
Enter fullscreen mode Exit fullscreen mode

Schema (SDL)

type User {
  required name: str;
  required email: str { constraint exclusive; };
  multi posts: Post;
}

type Post {
  required title: str;
  required body: str;
  required author: User;
  created_at: datetime { default := datetime_current(); };
}
Enter fullscreen mode Exit fullscreen mode

EdgeQL

# Insert
INSERT User { name := "Alice", email := "alice@example.com" };

# Query with nested data (no JOINs!)
SELECT User {
  name, email,
  posts: { title, created_at }
}
FILTER .email = "alice@example.com";

# Aggregation
SELECT User {
  name,
  post_count := count(.posts)
}
ORDER BY .post_count DESC;
Enter fullscreen mode Exit fullscreen mode

HTTP API

curl -X POST http://localhost:5656/branch/main/edgeql \
  -H "Content-Type: application/json" \
  -d '{"query":"SELECT User { name, email } LIMIT 10"}'
Enter fullscreen mode Exit fullscreen mode

Use Cases

  1. Modern apps — type-safe schema + queries
  2. Graph-like data — relations without JOINs
  3. APIs — built-in HTTP API
  4. Migrations — automatic schema migrations
  5. PostgreSQL upgrade — keep PostgreSQL, better DX

Need web data at scale? Check out my scraping tools on Apify or email spinov001@gmail.com for custom solutions.

Top comments (0)