Skip to content
systemsoftPublic

About

the database for users

Resources

Stars

9 stars

Watchers

1 watching

Forks

Latest commit

 

History

661 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A schema-first, TypeScript-native database built on Ende, a Deno fork. Disc is a fork of Gel (formerly EdgeDB), reimplemented in TypeScript while preserving EdgeQL, SDL schemas, and PostgreSQL as the storage engine.

Why Disc?

  • Single-language stack — TypeScript from schema to query to server
  • Deno-native — leverages Ende’s built-in TypeScript, permissions model, and Standard Library
  • Bundled PostgreSQL — disc init just works; users never install or manage Postgres directly
  • EdgeQL preserved — the query language is the best part of Gel, so it stays
  • Schema-first — SDL drives database schema, TypeScript types, and access policies

Install

curl -fsSL https://disc.sh/install | sh

This downloads the prebuilt disc binary into ~/.disc/bin and adds it to your PATH. Pin a version with ... | sh -s -- v2026.06.13. Prebuilt binaries cover macOS (arm64), Linux (x64/arm64), and Windows (x64); Disc is also available via Homebrew or from source.

Disc is also available on Homebrew!

Quick Start

# Initialize a new project (downloads PostgreSQL automatically)
disc init my-project
cd my-project

# Start the server
disc serve

# Open the admin UI
disc ui

# Interactive EdgeQL shell
disc shell

Schema Definition

Define your data model with SDL (Schema Definition Language):

module default {
  type User {
    created_at: datetime {
      default := datetime_current();
      readonly := true;
    };
    required email: str {
      constraint exclusive;
    };
    required name: str;
    multi posts: Post;
  };

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

Query with EdgeQL

select User {
  email,
  name,
  posts: {
    created_at,
    title
  }
} filter .email = "user@example.com";

Compiles to PostgreSQL SQL automatically.

CLI Commands

All commands auto-detect the project from disc.toml in the current (or parent) directory and auto-start PostgreSQL when needed. No manual DSN configuration required.

disc init                              # Initialize a new Disc project
disc start                             # Start the server and bundled PostgreSQL
disc stop                              # Stop the server and PostgreSQL
disc status                            # Show instance status
disc migrate                           # Generate and apply migrations
disc shell                             # Interactive EdgeQL REPL
disc codegen                           # Generate TypeScript types
disc codegen --rust                    # Generate a Rust client crate (./dbschema/disc-client-rust)
disc codegen --go                      # Generate a Go client package (./dbschema/disc-client-go)
disc watch                             # Watch schema files and auto-migrate in dev
disc serve                             # Start the Disc server
disc ui                                # Open admin UI in browser
disc build                             # Compile to native binary
disc build --platform linux-x64        # Cross-compile for Linux
disc deploy --format <fmt>             # Generate deployment scaffolds (docker, compose, systemd, env)
disc pg log                            # View PostgreSQL logs
disc pg log -f                         # Follow log output
disc pg upgrade --target-version 18.4  # Upgrade PostgreSQL

Architecture

+-----------------------------------------+
|               Disc Server               |
|           (Deno / TypeScript)           |
+-----------------------------------------+
|   Schema Parser   |    EdgeQL Parser    |
|   (SDL -> AST)    |    (EQL -> AST)     |
+-----------------------------------------+
|        Query Planner / Compiler         |
|        (AST -> SQL generation)          |
+-----------------------------------------+
|            Migration Engine             |
|          (Schema diff -> DDL)           |
+-----------------------------------------+
|           Connection Manager            |
|        (PostgreSQL via deno-pg)         |
+-----------------------------------------+
|           PostgreSQL Manager            |
|     (bundled binary lifecycle mgmt)     |
+-----------------------------------------+
                    |
+-----------------------------------------+
|         Bundled PostgreSQL 16+          |
|       ~/.disc/postgres/<version>/       |
+-----------------------------------------+

Features

Core

  • Full SDL parser and schema validation
  • EdgeQL parser with complete AST support
  • EdgeQL-to-SQL compiler with query caching
  • Automatic schema migrations with diffing
  • Bundled PostgreSQL lifecycle management
  • Real query execution against PostgreSQL

Server

  • HTTP/JSON API with WebSocket support
  • Rate limiting (token bucket per IP)
  • TLS/HTTPS with HTTP-to-HTTPS redirect
  • Prometheus metrics endpoint
  • Structured logging (JSON/text)
  • Graceful shutdown and health checks
  • Request timeouts and CORS

Security

  • JWT authentication with session management
  • Object-level access policies
  • Row-level security enforcement
  • Auth context bridging

Developer Experience

  • Admin UI (SvelteKit)
  • TypeScript type generation from schemas
  • Interactive EdgeQL REPL
  • Development file watcher with auto-migration
  • Production deployment guide

External PostgreSQL

For production deployments or users who prefer to manage their own Postgres:

disc init --backend-dsn "postgres://user:pass@host:5432/disc"

Deployment

Native Binary

The canonical build path is the disc build CLI command (wraps ende compile with the correct flags and cross-compile targets):

disc build                          # Build for current platform
disc build --platform linux-x64     # Cross-compile for Linux
disc build --platform linux-arm64   # Cross-compile for Linux ARM
disc build --platform windows-x64   # Cross-compile for Windows (-> disc-windows-x64.exe)

For release automation, the equivalent ende task aliases (build:darwin-arm64, build:linux-x64, etc.) call disc build under the hood. The justfile targets are retained for hands-on development but are not part of the release pipeline.

Version is read from version.txt at startup; ChronVer-style dates are bumped by just version.

Docker

docker build -t disc .              # Production image (external PG)
docker build -f Dockerfile.bundled -t disc-bundled .  # All-in-one with PG
docker compose up -d                # Start Disc + PostgreSQL

Scaffold Generator

disc deploy --format env            # Generate .env.production template
disc deploy --format systemd        # Generate systemd service unit
disc deploy --format compose        # Generate docker-compose.yml
disc deploy --format docker         # Generate Dockerfile

See Production Deployment Guide for full details including TLS setup, connection pool tuning, health checks, monitoring, and more.

Development

Disc's toolchain runs on Ende (curl -fsSL https://ende.sh/install.sh | sh); the admin UI under ui/ also needs Bun.

# Run tests
ende task test

# Run tests with PostgreSQL integration
ende task test:pg

# Format and lint
ende task format
ende task lint

# Dev server
ende task dev

The test, check, build, dev, serve, cli, and bench tasks all chain ende task prep first. prep writes an empty postgres/embedded-pg-manifest.ts stub if missing (the real manifest is git-ignored and regenerated by disc build). When invoking ende test/ende check directly, run ende task prep once after cloning.

License

Apache 2.0

About

the database for users

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages