Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/neo4j_lite_client/core/index.ts>driver.default

Unofficial Neo4j Driver for Deno
Latest
class driver.default
import { driver } from "https://deno.land/x/neo4j_lite_client@4.4.6/core/index.ts";
const { default } = driver;

A driver maintains one or more Sessions with a remote Neo4j instance. Through the Sessions you can send queries and retrieve results from the database.

Drivers are reasonably expensive to create - you should strive to keep one driver instance around per Neo4j Instance you connect to.

Constructors

new
default(
meta: MetaInfo,
config?: DriverConfig,
createConnectonProvider: CreateConnectionProvider,
createSession?: CreateSession,
)

You should not be calling this directly, instead use driver.

Properties

private
readonly
_config: DriverConfig
private
_connectionProvider: ConnectionProvider | null
private
readonly
_createConnectionProvider: CreateConnectionProvider
private
readonly
_createSession: CreateSession
private
readonly
_id: number
private
readonly
_log: Logger
private
readonly
_meta: MetaInfo

Methods

_getTrust(): TrustStrategy | undefined

Returns the configured trust strategy that the driver has been configured with.

Returns boolean to indicate if driver has been configured with encryption enabled.

_newSession(unnamed 0: { defaultAccessMode: SessionMode; bookmarkOrBookmarks?: string | string[]; database: string; reactive: boolean; impersonatedUser?: string; fetchSize: number; })
_supportsRouting(): boolean
close(): Promise<void>

Close all open sessions and other associated resources. You should make sure to use this when you are done with this driver instance.

session(unnamed 0?: { defaultAccessMode?: SessionMode; bookmarks?: string | string[]; database?: string; impersonatedUser?: string; fetchSize?: number; }): Session

Acquire a session to communicate with the database. The session will borrow connections from the underlying connection pool as required and should be considered lightweight and disposable.

This comes with some responsibility - make sure you always call close when you are done using a session, and likewise, make sure you don't close your session before you are done using it. Once it is closed, the underlying connection will be released to the connection pool and made available for others to use.

supportsMultiDb(): Promise<boolean>

Returns whether the server supports multi database capabilities based on the protocol version negotiated via handshake.

Note that this function call always causes a round-trip to the server.

supportsTransactionConfig(): Promise<boolean>

Returns whether the server supports transaction config capabilities based on the protocol version negotiated via handshake.

Note that this function call always causes a round-trip to the server.

supportsUserImpersonation(): Promise<boolean>

Returns whether the server supports user impersonation capabilities based on the protocol version negotiated via handshake.

Note that this function call always causes a round-trip to the server.

verifyConnectivity(unnamed 0?: { database?: string; }): Promise<ServerInfo>

Verifies connectivity of this driver by trying to open a connection with the provided driver options.