1 Star 0 Fork 10

wjmboss / edgedb

forked from EdgeDB / edgedb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 3.05 KB
一键复制 编辑 原始数据 按行查看 历史
Yury Selivanov 提交于 2021-08-11 21:30 . readme: Fix the example query

Build Status Join GitHub discussions

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 -> cal::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[IS Review]
        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 beta. 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.

1
https://gitee.com/wjmboss/edgedb.git
git@gitee.com:wjmboss/edgedb.git
wjmboss
edgedb
edgedb
master

搜索帮助