Documentation

TypeDB.Schema

Schema generation and verification #

Schema.defineText turns the mapped types into one TypeQL define: attribute types with their value types, entity and relation types with sub, owns (with @key and @card) and relates, and the plays of every role player. Schema.verify checks a live database against the same mappings and lists every difference.

What the schema needs to know about one mapped type.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The schema description of a mapped type: TypeSpec.of Person.

      Equations
      Instances For

        The TypeQL define for the mapped types, or an error if two types give the same attribute different value types.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The define query for the mapped types.

          Equations
          Instances For

            Defines the mapped types in the current schema transaction. Unchanged types are left as they are, so running it again is harmless.

            Equations
            Instances For

              Runs the TypeQL in a file, e.g. a define schema.

              Equations
              Instances For

                Every difference between the mapped types and the database's schema.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Fails with TypeDBError.schemaMismatch unless the database matches the mapped types.

                  Equations
                  Instances For