EdgeDB

下一代关系型数据库。(The next generation relational database.)

Github星跟踪图

EdgeDB

什么是 EdgeDB?

EdgeDB 是一个建立在 PostgreSQL 之上的开源对象关系数据库。EdgeDB 的目标是使其用户能够以较少的努力建立安全和高效的软件。

EdgeDB 的特点是

  • 严格的,强类型的模式,
  • 强大的、富有表现力的查询语言。
  • 丰富的标准库。
  • 内置支持模式迁移。
  • 原生的GraphQL支持。

查看 博客 文章,了解更多的例子和EdgeDB背后的理念。

现代类型安全模式

EdgeDB 中的数据模式是概念数据模型的干净的高级表示:

type User {
    required property name -> str;
}

type Person {
    required property first_name -> str;
    required property last_name -> str;
}

type Review {
    required property body -> str;
    required property rating -> int64 {
        constraint min_value(0);
        constraint max_value(5);
    }
    required link author -> User;
    required link movie -> Movie;
    required property creation_time -> local_datetime;
}

type Movie {
    required property title -> str;
    required property year -> int64;
    required property description -> str;
    multi link directors -> Person;
    multi link cast -> Person;
    property avg_rating := math::mean(.<movie[IS Review].rating);
}

EdgeDB 有一个丰富的数据类型和函数库。

EdgeQL

EdgeQL 是 EdgeDB 的查询语言。它高效、直观、易学。

EdgeQL 支持获取对象层次结构,具有任意的嵌套、过滤、排序和聚合水平。

SELECT User {
    id,
    name,
    image,
    latest_reviews := (
        WITH UserReviews := User.<author
        SELECT UserReviews {
            id,
            body,
            rating,
            movie: {
                id,
                title,
                avg_rating,
            }
        }
        ORDER BY .creation_time DESC
        LIMIT 10
    )
}
FILTER .id = <uuid>$id

状态

EdgeDB 目前处于 alpha 阶段。请看我们的 Issues 以获得计划中的或正在开发中的特性列表。

入门

请参考 教程 部分的文档关于如何安装和运行EdgeDB。

文档

EdgeDB 文档可以在 edgedb.com/docs 找到。

从源代码构建

请遵循 文档中 的说明。

许可证

本仓库中的代码是在 Apache 2.0 许可下开发和发布的。详情请看 LICENSE


主要指标

概览
名称与所有者geldata/gel
主编程语言Python
编程语言Python (语言数: 11)
平台Docker, Linux, Mac
许可证Apache License 2.0
所有者活动
创建于2017-06-29 20:30:48
推送于2025-04-24 11:08:33
最后一次提交2025-04-24 12:00:18
发布数100
最新版本名称v6.5 (发布于 2025-04-14 15:26:28)
第一版名称v1.0a1 (发布于 2019-04-10 13:33:37)
用户参与
星数13.6k
关注者数100
派生数414
提交数9.5k
已启用问题?
问题数2568
打开的问题数815
拉请求数5112
打开的拉请求数68
关闭的拉请求数294
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

Build Status Join the community on Spectrum

What is EdgeDB?

EdgeDB is an open-source object-relational database built on top of
PostgreSQL. The goal of EdgeDB is to empower its users to build safe
and efficient software with less effort.

EdgeDB features:

  • strict, strongly typed schema;
  • powerful and expressive query language;
  • rich standard library;
  • built-in support for schema migrations;
  • native GraphQL support.

Check out the blog
posts for more examples and
the philosophy behind EdgeDB.

Modern Type-safe Schema

The data schema in EdgeDB is a clean high-level representation of a conceptual
data model:

type User {
    required property name -> str;
}

type Person {
    required property first_name -> str;
    required property last_name -> str;
}

type Review {
    required property body -> str;
    required property rating -> int64 {
        constraint min_value(0);
        constraint max_value(5);
    }

    required link author -> User;
    required link movie -> Movie;

    required property creation_time -> local_datetime;
}

type Movie {
    required property title -> str;
    required property year -> int64;
    required property description -> str;

    multi link directors -> Person;
    multi link cast -> Person;

    property avg_rating := math::mean(.<movie[IS Review].rating);
}

EdgeDB has a rich library of datatypes and functions.

EdgeQL

EdgeQL is the query language of EdgeDB. It is efficient, intuitive, and easy
to learn.

EdgeQL supports fetching object hierarchies with arbitrary level of nesting,
filtering, sorting and aggregation:

SELECT User {
    id,
    name,
    image,
    latest_reviews := (
        WITH UserReviews := User.<author
        SELECT UserReviews {
            id,
            body,
            rating,
            movie: {
                id,
                title,
                avg_rating,
            }
        }
        ORDER BY .creation_time DESC
        LIMIT 10
    )
}
FILTER .id = <uuid>$id

Status

EdgeDB is currently in alpha. See our
Issues for a list of features
planned or in development.

Getting Started

Please refer to the Tutorial section
of the documentation on how to install and run EdgeDB.

Documentation

The EdgeDB documentation can be found at
edgedb.com/docs.

Building From Source

Please follow the instructions outlined
in the documentation.

License

The code in this repository is developed and distributed under the
Apache 2.0 license. See LICENSE for details.