Interface IDriver
The IDriver instance maintains the connections with a Neo4j database, providing an access point via the IAsyncSession interface and the ExecutableQuery method.
public interface IDriver : IDisposable, IAsyncDisposable
- Inherited Members
- Extension Methods
Remarks
The driver object is thread-safe and can be shared across threads.
When the driver is disposed — for example at the end of a using block — all connections
to the database are closed. Ensure that all sessions, transactions, and other resources obtained
from the driver have been closed before disposal. Using the driver or any of its
resources concurrently with disposal results in unspecified behavior, which may include
deadlocks, data races, or errors.
Properties
- Config
Gets the driver configurations.
- Encrypted
Gets Encrypted status
Methods
- AsyncSession()
Obtain a session with the default SessionConfig.
- AsyncSession(Action<SessionConfigBuilder>)
Obtain a session with the customized SessionConfig.
- ExecutableQuery(string)
Gets an IExecutableQuery<TIn, TOut> that can be used to configure and execute a query using fluent method chaining.
- GetExecutableQueryBookmarkManager()
Returns an IBookmarkManager interface to the bookmark manager that the driver is using to ensure causal consistency between calls to the ExecutableQuery interface. This can be used to have causal consistency when using the API interfaces supplied by Session objects alongside calls to ExecutableQuery.
- GetServerInfoAsync()
Asynchronously verify if the driver can connect to the remote server returning server info. If the driver fails to connect to the remote server, an error will be thrown, which can be used to further understand the cause of the connectivity issue. Note: Even if this method failed with an error, the driver still needs to be disposed to free up all resources.
- SupportsMultiDbAsync()
Asynchronously verify if the driver connects to a server and/or cluster that can support multi-database feature.
- SupportsSessionAuthAsync()
Asynchronously verify if the driver supports re-auth.
- TryVerifyConnectivityAsync()
Asynchronously verify if the driver can connect to the remote server.
- VerifyAuthenticationAsync(IAuthToken)
Asynchronously verify if the driver can connect using the
authToken.
Try to establish a working read connection to the remote server or a member of a cluster and exchange some data.In a cluster, there is no guarantee about which server will be contacted. If the data exchange is successful and the authentication information is valid, true is returned. Otherwise, the error will be matched against a list of known authentication errors.If the error is on that list, false is returned indicating that the authentication information is invalid. If the not on the list, the error is thrown.
- VerifyConnectivityAsync()
Asynchronously verify if the driver can connect to the remote server by establishing a network connection with the remote. If the driver fails to connect to the remote server, an error will be thrown, which can be used to further understand the cause of the connectivity issue. Note: Even if this method failed with an error, the driver still need to be disposed to free up all resources.