Documentation

TypeDB.Driver

Connecting and managing databases #

Driver.connect opens one connection, which every transaction shares. The driver multiplexes concurrent transactions over it, so there is no pool.

inductive TypeDB.Tls :

TLS settings for a connection.

  • disabled : Tls
  • system : Tls

    TLS with the operating system's root certificates.

  • rootCA (path : System.FilePath) : Tls

    TLS with a custom root CA certificate (PEM file).

Instances For
    @[instance_reducible]
    Equations
    Equations
    Instances For
      structure TypeDB.Config :

      How to reach and authenticate with a server.

      • address : String
      • username : String
      • password : String
      • tls : Tls
      • requestTimeoutMs : Nat

        Request timeout in milliseconds; 0 keeps the driver's default.

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

          Options applied to every transaction a run opens.

          • timeoutMs : Nat

            Transaction timeout in milliseconds; 0 keeps the server's default.

          • prefetch : Nat

            How many answers the server sends ahead of the client's reads; 0 keeps the server's default, which is small enough to make large scans wait on the network.

          • batchSize : Nat

            How many rows one native call decodes.

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

              An open connection to a TypeDB server. Safe to share between threads.

              Instances For

                Connects to a server. Fails with TypeDBError.connection if the server is unreachable or refuses the credentials.

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

                  Closes the connection. Later calls on this driver fail.

                  Equations
                  Instances For
                    def TypeDB.Driver.withDriver {α : Type} (config : Config) (f : Driver → EIO TypeDBError α) :

                    Connects, runs f, and closes the connection whatever f does.

                    Equations
                    Instances For

                      Databases #

                      Creates a database; fails if one with that name exists.

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

                        The database's schema and functions as TypeQL define text.

                        Equations
                        Instances For

                          The database's types only, without functions.

                          Equations
                          Instances For

                            Creates the database unless it exists.

                            Equations
                            Instances For