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.
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
Equations
- TypeDB.instReprTls = { reprPrec := TypeDB.instReprTls.repr }
Equations
- One or more equations did not get rendered due to their size.
- TypeDB.instReprTls.repr TypeDB.Tls.disabled prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TypeDB.Tls.disabled")).group prec✝
- TypeDB.instReprTls.repr TypeDB.Tls.system prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TypeDB.Tls.system")).group prec✝
Instances For
Equations
- TypeDB.instInhabitedTls = { default := TypeDB.instInhabitedTls.default }
Equations
- TypeDB.instReprConfig = { reprPrec := TypeDB.instReprConfig.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
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
- TypeDB.instReprTxOptions = { reprPrec := TypeDB.instReprTxOptions.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
An open connection to a TypeDB server. Safe to share between threads.
- handle : Native.DriverHandle
- config : Config
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
Equations
Instances For
Connects, runs f, and closes the connection whatever f does.
Equations
- TypeDB.Driver.withDriver config f = do let d ← TypeDB.Driver.connect config tryFinally (f d) (discard (liftM d.close.toBaseIO))
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
Equations
- d.databaseExists name = TypeDB.native (TypeDB.Native.dbContains d.handle name)
Instances For
Equations
- d.deleteDatabase name = TypeDB.native (TypeDB.Native.dbDelete d.handle name)
Instances For
Equations
Instances For
The database's schema and functions as TypeQL define text.
Equations
- d.schema name = TypeDB.native (TypeDB.Native.dbSchema d.handle name 0)
Instances For
The database's types only, without functions.
Equations
- d.typeSchema name = TypeDB.native (TypeDB.Native.dbSchema d.handle name 1)
Instances For
Creates the database unless it exists.
Equations
- d.ensureDatabase name = do let __do_lift ← d.databaseExists name if __do_lift = true then pure () else d.createDatabase name