Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(multiDbSupport => {
if (!driver || !driver.session) return rej('No connection')
const tmp = driver.session({
defaultAccessMode: neo4j.session.READ,
database: multiDbSupport ? 'system' : undefined
})
tmp
.run('CALL db.indexes()')
.then(() => {
tmp.close()
res(driver)
})
.catch(e => {
// Only invalidate the connection if not available
// or not authed
// or credentials have expired
const invalidStates = [
'ServiceUnavailable',
'Neo.ClientError.Security.AuthenticationRateLimit',
'Neo.ClientError.Security.Unauthorized',
export function directTransaction(
input,
parameters,
requestId = null,
cancelable = false,
txMetadata = undefined,
useDb = undefined
) {
const session = _drivers
? _drivers
.getDirectDriver()
.session({ defaultAccessMode: neo4j.session.WRITE, database: useDb })
: false
if (!cancelable) return _transaction(input, parameters, session, txMetadata)
return _trackedTransaction(input, parameters, session, requestId, txMetadata)
}