Connection Parameters
The EdgeDBClient
constructor can accept an EdgeDBConnection
class which
specifies how the client should connect to EdgeDB. The main way to to construct
a EdgeDBConnection
is to use the static helper methods:
The TLSCertData
property is obselete following version 1.0 and
higher.
Represents a client-facing connection to EdgeDB.
-
Username
(string
) – The username used to connect to the database. Defaults to"edgedb"
. -
Password
(string?
) – The password to connect to the database. -
Hostname
(string
) – The hostname of the EdgeDB instance. Defaults to"127.0.0.1"
. -
Port
(int
) – The port of the EdgeDB instance to connect to. Defaults to5656
. -
Database
(string?
) – The database name to use when connecting. Defaults to"edgedb"
. -
TLSSecurity
(TLSSecurityMode
) – The TLS security level. Defaults toTLSSecurityMode.Strict
.
Creates a EdgeDBConnection
from an EdgeDB DSN.
-
dsn
(string
) – The DSN to create the connection from.
A EdgeDBConnection
representing the DSN.
-
ArgumentException
– A query parameter has already been defined in the DSN. -
FormatException
– Port was not in the correct format of int. -
FileNotFoundException
– A file parameter wasn’t found. -
KeyNotFoundException
– An environment variable couldn’t be found.
Creates a EdgeDBConnection
from a .toml
project file.
-
path
(string
) – The path to the.toml
project file.
A EdgeDBConnection
representing the project defined in
the .toml
file.
-
FileNotFoundException
– The supplied file path, credentials path, or instance-name file doesn’t exist. -
DirectoryNotFoundException
– The project directory doesn’t exist for the supplied toml file.
Creates a EdgeDBConnection
from an instance name.
-
name
(string
) – The name of the instance.
A EdgeDBConnection
containing connection details for
the specific instance.
FileNotFoundException
– The instances config file couldn’t be found.
Resolves a connection by traversing the current working directory and
its parents
to find an edgedb.toml
file.
A resolved EdgeDBConnection
.
FileNotFoundException
– No edgedb.toml
file could be found.
Parses the provided arguments to build a EdgeDBConnection
;
parse logic follows the Priority Levels of arguments.
-
instance
(string?
) – The instance name to connect to. -
dsn
(string?
) – The DSN string to use to connect. -
configure
(Action<EdgeDBConnection>?
) – A configuration delegate. -
autoResolve
(bool
) – Whether or not to autoresolve a connection usingEdgeDBConnection.ResolveEdgeDBTOML()
.
A EdgeDBConnection
that can be used to connect to a
EdgeDB instance.
-
ConfigurationException
– An error occured while parsing or configuring theEdgeDBConnection
. -
FileNotFoundException
– A configuration file could not be found.