Skip to content

[5.x] Update docs link #1310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: 6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
Resources to get you started:

- [API Documentation](https://neo4j.com/docs/api/javascript-driver/current/)
- [Neo4j Manual](https://neo4j.com/docs/)
- [Neo4j Refcard](https://neo4j.com/docs/cypher-refcard/current/)
- [Neo4j Driver Manual](https://neo4j.com/docs/javascript-manual/current/)
- [Neo4j Cypher Cheatsheet](http://neo4j.com/docs/cypher-cheat-sheet/)

## What's New in 5.x

Expand Down
2 changes: 1 addition & 1 deletion packages/core/esdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"enable": true
},
"brand": {
"title": "Neo4j Bolt Driver 4.1 for JavaScript",
"title": "Neo4j Bolt Driver 6.x for JavaScript",
"repository": "https://github.com/neo4j/neo4j-javascript-driver"
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,12 @@ class Driver {
/**
* Close all open sessions and other associated resources. You should
* make sure to use this when you are done with this driver instance.
*
* This will interrupt any running connections.
* Make sure you are done using the driver object and any resources
* spawned from it (such as sessions or transactions) while calling
* this method. Failing to do so will result in unspecified behavior.
*
* @public
* @return {Promise<void>} promise resolved when the driver is closed.
*/
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ class GQLError extends Error {
* @public
*/
this.rawClassification = diagnosticRecord?._classification ?? undefined
/**
* Represents the name for the type of error, inherited from base JavaScript {@link Error}.
* Will be 'GQLError' for {@link GQLError}s and 'Neo4jError' for {@link Neo4jError}s.
*
* @type {string}
* @public
*/
this.name = 'GQLError'
}

Expand All @@ -171,6 +178,11 @@ class Neo4jError extends GQLError {
* Optional error code. Will be populated when error originates in the database.
*/
code: string

/**
* Whether the request that caused this error can be safely retried without duplicate commits on the server.
* This does not apply when running auto-commit transactions using {@link Session#run}
*/
retriable: boolean

/**
Expand All @@ -195,7 +207,21 @@ class Neo4jError extends GQLError {
*/
this.code = code

/**
* The name of the type of error.
*
* @type {string}
* @public
*/
this.name = 'Neo4jError'

/**
* If the error is considered retriable.
* This does not apply when running auto-commit transactions using {@link Session#run}
*
* @type {boolean}
* @public
*/
this.retriable = _isRetriableCode(code)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Result<R extends RecordShape = RecordShape> implements Promise<QueryResult
/**
* Provides a async iterator over the records in the result.
*
* *Should not be combined with {@link Result#subscribe} or ${@link Result#then} functions.*
* *Should not be combined with {@link Result#subscribe} or {@link Result#then} functions.*
*
* @public
* @returns {PeekableAsyncIterator<Record<R>, ResultSummary>} The async iterator for the Results
Expand Down
4 changes: 2 additions & 2 deletions packages/neo4j-driver-deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
Resources to get you started:

- [API Documentation](https://neo4j.com/docs/api/javascript-driver/current/)
- [Neo4j Manual](https://neo4j.com/docs/)
- [Neo4j Refcard](https://neo4j.com/docs/cypher-refcard/current/)
- [Neo4j Driver Manual](https://neo4j.com/docs/javascript-manual/current/)
- [Neo4j Cypher Cheatsheet](http://neo4j.com/docs/cypher-cheat-sheet/)
- [TLS](#tls)

## What's New in 5.x
Expand Down
4 changes: 2 additions & 2 deletions packages/neo4j-driver-deno/lib/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/neo4j-driver-deno/lib/core/driver.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions packages/neo4j-driver-deno/lib/core/error.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/neo4j-driver-deno/lib/core/result.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/neo4j-driver-lite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
Resources to get you started:

- [API Documentation](https://neo4j.com/docs/api/javascript-driver/current/)
- [Neo4j Manual](https://neo4j.com/docs/)
- [Neo4j Refcard](https://neo4j.com/docs/cypher-refcard/current/)
- [Neo4j Driver Manual](https://neo4j.com/docs/javascript-manual/current/)
- [Neo4j Cypher Cheatsheet](http://neo4j.com/docs/cypher-cheat-sheet/)

## What's New in 5.x

Expand Down
2 changes: 1 addition & 1 deletion packages/neo4j-driver-lite/esdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"enable": false
},
"brand": {
"title": "Neo4j Bolt Lite Driver 5.x for JavaScript",
"title": "Neo4j Bolt Lite Driver 6.x for JavaScript",
"repository": "https://github.com/neo4j/neo4j-javascript-driver"
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/neo4j-driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
Resources to get you started:

- [API Documentation](https://neo4j.com/docs/api/javascript-driver/current/)
- [Neo4j Manual](https://neo4j.com/docs/)
- [Neo4j Refcard](https://neo4j.com/docs/cypher-refcard/current/)
- [Neo4j Driver Manual](https://neo4j.com/docs/javascript-manual/current/)
- [Neo4j Cypher Cheatsheet](http://neo4j.com/docs/cypher-cheat-sheet/)

## What's New in 5.x

Expand Down
2 changes: 1 addition & 1 deletion packages/neo4j-driver/esdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"enable": true
},
"brand": {
"title": "Neo4j Bolt Driver 5.x for JavaScript",
"title": "Neo4j Bolt Driver 6.x for JavaScript",
"repository": "https://github.com/neo4j/neo4j-javascript-driver"
}
}
Expand Down
11 changes: 6 additions & 5 deletions packages/testkit-backend/src/request-handlers-rx.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as responses from './responses.js'
import { from } from 'rxjs'
import stringify from './stringify.js'

// Handlers which didn't change depending
export {
Expand Down Expand Up @@ -108,7 +109,7 @@ export function SessionRun (_, context, data, wire) {
try {
rxResult = session.run(cypher, params, { metadata, timeout })
} catch (e) {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
return
}
Expand Down Expand Up @@ -150,11 +151,11 @@ export function SessionBeginTransaction (_, context, data, wire) {
const id = context.addTx(tx, sessionId)
wire.writeResponse(responses.Transaction({ id }))
}).catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
} catch (e) {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
}
}
Expand Down Expand Up @@ -189,7 +190,7 @@ export function TransactionRollback (_, context, data, wire) {
.toPromise()
.then(() => wire.writeResponse(responses.Transaction({ id })))
.catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
}
Expand All @@ -201,7 +202,7 @@ export function TransactionCommit (_, context, data, wire) {
.toPromise()
.then(() => wire.writeResponse(responses.Transaction({ id })))
.catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
}
Expand Down
17 changes: 9 additions & 8 deletions packages/testkit-backend/src/request-handlers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as responses from './responses.js'
import configurableConsole from './console.configurable.js'
import stringify from './stringify.js'

export function throwFrontendError () {
throw new Error('TestKit FrontendError')
Expand Down Expand Up @@ -191,7 +192,7 @@ export function SessionRun (_, context, data, wire) {
try {
result = session.run(cypher, params, { metadata, timeout })
} catch (e) {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
return
}
Expand All @@ -214,7 +215,7 @@ export function ResultNext (_, context, data, wire) {
wire.writeResponse(responses.Record({ record: value }, { binder: context.binder }))
}
}).catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
}
Expand All @@ -232,7 +233,7 @@ export function ResultPeek (_, context, data, wire) {
wire.writeResponse(responses.Record({ record: value }, { binder: context.binder }))
}
}).catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
}
Expand All @@ -241,8 +242,8 @@ export function ResultConsume (_, context, data, wire) {
const { resultId } = data
const result = context.getResult(resultId)

let summaryPromise = 'recordIt' in result
? (async () => {return (await result.recordIt.return()).value})()
const summaryPromise = 'recordIt' in result
? (async () => { return (await result.recordIt.return()).value })()
: result.summary()
return summaryPromise.then(summary => {
wire.writeResponse(responses.Summary({ summary }, { binder: context.binder }))
Expand Down Expand Up @@ -317,11 +318,11 @@ export function SessionBeginTransaction (_, context, data, wire) {
const id = context.addTx(tx, sessionId)
wire.writeResponse(responses.Transaction({ id }))
}).catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
} catch (e) {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
}
}
Expand All @@ -332,7 +333,7 @@ export function TransactionCommit (_, context, data, wire) {
return tx.commit()
.then(() => wire.writeResponse(responses.Transaction({ id })))
.catch(e => {
console.log('got some err: ' + JSON.stringify(e))
console.log('got some err: ' + stringify(e))
wire.writeError(e)
})
}
Expand Down
12 changes: 11 additions & 1 deletion packages/testkit-backend/src/skipped-tests/rx.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { skip, ifEquals } from './skip.js'
import { skip, ifEquals, ifStartsWith } from './skip.js'

const skippedTests = [
skip(
'Throws after run insted of the first next because of the backend implementation',
ifEquals('stub.disconnects.test_disconnects.TestDisconnects.test_disconnect_on_tx_begin')
),
skip(
'Reactive driver does not send DISCARD on consume if records stream has been subscribed to',
ifStartsWith('stub.summary.test_summary.TestSummaryPlanDiscard'),
ifStartsWith('stub.summary.test_summary.TestSummaryCountersDiscard'),
ifStartsWith('stub.summary.test_summary.TestSummaryBasicInfoDiscard'),
ifStartsWith('stub.summary.test_summary.TestSummaryGqlStatusObjects4x4Discard'),
ifStartsWith('stub.summary.test_summary.TestSummaryGqlStatusObjects5x6Discard'),
ifStartsWith('stub.summary.test_summary.TestSummaryNotifications4x4Discard'),
ifStartsWith('stub.summary.test_summary.TestSummaryNotifications5x6Discard')
)
]

Expand Down
2 changes: 1 addition & 1 deletion testkit/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if is_lite():
ignore = "--ignore=neo4j-driver"
else:
ignore = "--ignore=neo4j-driver-lite"
ignore = "--ignore=neo4j-driver-@(lite|deno)"

if is_deno():
pass
Expand Down
2 changes: 1 addition & 1 deletion testkit/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if is_lite():
ignore = "--ignore=neo4j-driver"
else:
ignore = "--ignore=neo4j-driver-lite"
ignore = "--ignore=neo4j-driver-@(lite|deno)"

if not is_deno():
run_in_driver_repo(["npm", "run", "test::stress", "--", ignore],
Expand Down
2 changes: 1 addition & 1 deletion testkit/unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if is_lite() or is_deno():
ignore = "--ignore=neo4j-driver"
else:
ignore = "--ignore=neo4j-driver-lite"
ignore = "--ignore=neo4j-driver-@(lite|deno)"

run_in_driver_repo(["npm", "run", "lint"])
run_in_driver_repo(["npm", "run", "test::unit", "--", ignore])
Expand Down