Object Types

Object types are the primary components of EdgeDB schema. An object type is a collection of named properties and links to other object types. An instance of an object type is called an object. All data in EdgeDB is represented by objects and by links between objects.

Every object has a globally unique identity represented by a UUID value. An object’s identity is assigned upon creation and never changes. Referring to its id property yields its identity as a uuid value. Once set, the value of the id property cannot be changed or masked with a different computable expression.

Object types can extend other object types, in which case the extending type is called a subtype and types being extended are called supertypes. A subtype inherits all links, properties and other aspects of its supertypes. It is possible to extend more than one type - that’s called multiple inheritance. This mechanism allows building complex object types out of combinations of more basic types.

std::BaseObject is the root of the object type hierarchy and all object types in EdgeDB, including system types, extend std::BaseObject directly or indirectly. User-defined object types extend from std::Object, which is a subtype of std::BaseObject.

type
BaseObject

Root object type.

Definition:

Copy
abstract type std::BaseObject {
    # Universally unique object identifier
    required readonly property id -> uuid;

    # Object type in the information schema.
    required readonly link __type__ -> schema::ObjectType;
}
type
Object

Root object type for user-defined types.

Definition:

Copy
abstract type std::Object extending std::BaseObject;

Object type SDL, DDL, and introspection.

Light
Dark
System