EdgeDB

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

Github stars Tracking Chart

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


Overview

Name With Owneredgedb/edgedb
Primary LanguagePython
Program languagePython (Language Count: 7)
PlatformDocker, Linux, Mac
License:Apache License 2.0
Release Count80
Last Release Namev5.3 (Posted on 2024-05-03 15:00:37)
First Release Namev1.0a1 (Posted on 2019-04-10 13:33:37)
Created At2017-06-29 20:30:48
Pushed At2024-05-15 22:53:20
Last Commit At2024-05-15 13:46:28
Stargazers Count12.6k
Watchers Count104
Fork Count389
Commits Count8.6k
Has Issues Enabled
Issues Count2267
Issue Open Count695
Pull Requests Count4225
Pull Requests Open Count47
Pull Requests Close Count246
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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.

To the top