Overview

EdgeDB is an object-relational database with strongly typed schema.

An EdgeDB schema is primarily composed from object type definitions, which describe entities in a specific domain. An object type is a collection of named properties and links to other types.

Here is an example of a simple EdgeDB type using the Edge Schema notation:

type User {
    property name -> str;
    property address -> str;
    multi link friends -> User;
}

str in the above example is a scalar type. EdgeDB also supports collection types. Scalar types and collection types are collectively called primitive types in contrast with object types.

EdgeDB schemas consist of modules. Modules contain schema items.

There are several kinds of schema items:

Most items in EdgeDB schema support inheritance as a composition mechanism. Schema items can extend other item(s) of the same kind. When extending, child items inherit the aspects of the parent item(s) in a manner specific to the schema item kind. For example, when an object type extends another object type, it inherits all parent properties, links, constraints and other aspects. Additionally, for instances of the child type object IS ParentType is true (see IS operator). Also, instances of the child type are included in the set of all instances of the parent type.

EdgeDB schema definition language is a high-level declarative alternative to EdgeDB data definition commands. It is designed to be a concise and readable representation of schema state. Most of the examples and synopses in this section use the SDL notation.