import { Session } from "https://deno.land/x/neo4j_lite_client@4.4.6/core/index.ts";
A Session instance is used for handling the connection and sending queries through the connection. In a single session, multiple queries will be executed serially. In order to execute parallel queries, multiple sessions are required.
Constructors
Methods
Sets the resolved database name in the session context.
Begin a new transaction in this session. A session can have at most one transaction running at a time, if you want to run multiple concurrent transactions, you should use multiple concurrent sessions.
While a transaction is open the session cannot be used to run queries outside the transaction.
Execute given unit of work in a READ transaction.
Transaction will automatically be committed unless the given function throws or returns a rejected promise.
Some failures of the given function or the commit itself will be retried with exponential backoff with initial
delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
maxTransactionRetryTime
property in milliseconds.
Run Cypher query
Could be called with a query object i.e.: {text: "MATCH ...", parameters: {param: 1}}
or with the query and parameters as separate arguments.
Execute given unit of work in a WRITE transaction.
Transaction will automatically be committed unless the given function throws or returns a rejected promise.
Some failures of the given function or the commit itself will be retried with exponential backoff with initial
delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
maxTransactionRetryTime
property in milliseconds.