-
Notifications
You must be signed in to change notification settings - Fork 71
5.x changelog
🆕 Features / Improvements
- [2a4727c] Docs: improve wording explaining ExecuteQuery (#609)
🐛 Bug fixes
- [a9c3fc5] Fix race condition in pool (#610)
🆕 Features / Improvements
- [9a93d3e] GQL Compliant Errors (ℹ️ in preview) (#607)
- [8d40e8b] TestKit: serialize Neo4j error messages (#604)
🐛 Bug fixes
- [9e6857b] Retry mechanism doesn't respect the context (#601)
- [2341390] Fix race conditions in unit tests and enable race check in tests (#521)
- [5ebc91d] Fix unit test not waiting for go routine to finish (#606)
- [54c9d19] Fix nil pointer errors on unit test failure (#605)
🆕 Features / Improvements
- [d8c7383] Fix issue template typos (#602)
🆕 Features / Improvements
-
[6ecad42] Add
SCHEMA
notification category (#594) - [778d6ba] Pre-commit hook: fix staticcheck version selection by go version (#595)
💚 Special thanks to
🐛 Bug fixes
- [190a74b] Fix hydrator path overflow bug (#592)
🆕 Features / Improvements
-
[f49845b] Add
GqlStatusObject
support as notifications toResultSummary
(ℹ️ in preview). (#588) - [14cbf69] Significant performance improvement through buffered reading. (#581)
-
[a8c8342] Clarify
FetchAll
behavior inline docs (#586)
This release contains no significant changes or new features.
🆕 Features / Improvements
- [7772a81] Updated name of skipped Testkit test due to upcoming GqlStatusObject work. (#585)
- [8836143] Disabled flakey stress test. (#585)
This release contains no significant changes or new features.
🆕 Features / Improvements
- [55358a7] Introduced mutual TLS for 2-factor authentication (ℹ️ in preview). (#573)
🐛 Bug fixes
-
[fc81a16] Documentation fix - doc comment for
ExecuteQuery
was incorrect. (#575)
💚 Special thanks to
🆕 Features / Improvements
-
[ed22096] Added
ExecuteQueryWithAuthToken
configuration option (#564) - [ef1b68f] Added initial BenchKit backend implementation (#566)
🐛 Bug fixes
-
[21c64d6] Return an error if operation is attempted on a closed session (#570)
⚠️ Breaking Change: This update fixes a critical bug where operations on a closed session were incorrectly allowed. If your code was relying on this behavior, it may now encounter aUsageError
. Please review your usage of closed sessions to ensure compatibility. The error message for operations on closed sessions is: "Operation attempted on a closed session".
🆕 Features / Improvements
- [d7aed10] Added String representations for temporal types (#561)
🐛 Bug fixes
- [a3fa881] Cleaned up logging packaging (#560)
- [373bd39] Updated to non-racing lock for driver pool (#552)
- [94725fd] Fixed race condition: pool kept connections after closure (#562)
🆕 Features / Improvements
-
[4354f3a] Added
ExecuteQueryWithTransactionConfig
option forExecuteQuery
(#553) -
[84b51fe] Added
ConnectionLivenessCheckTimeout
configuration (#551) - [ddb0635] Minor code clean-ups (#554)
🐛 Bug fixes
- [ac6a50b] Abort health check loop on done context (#555)
- [042c154] Avoid I/O while holding the pool's queue lock (#556)
- [fdbce9f] Pool: notify fewer waiters on returned connection (#559)
- [29fad8a] Fixed concurrent auth token map modification (#558)
💚 Special thanks to
🆕 Features / Improvements
- [e3e27ee] Enhance Neo4j integration test configuration (#544)
- [b0a4f07] Updated licence headers (#546)
- [88f48ad] Fixed typo in godoc for driver_with_context.go (#535)
🐛 Bug fixes
- [4d8aa8f] Fixed transaction termination handling (#536)
💚 Special thanks to
🆕 Features / Improvements
🐛 Bug fixes
- [16b4b5f] Closed channel instead of sending empty struct to signal update of the routing table (#540)
🆕 Features / Improvements
- [54efcda] Added Bolt 5.4 support and Telemetry API. (#533)
- [7d6cead] Improved transaction timeout documentation. (#531)
🆕 Features / Improvements
-
[553515c] Pipelined
ExecuteQuery
is now more efficient by saving a round trip. (#522) -
[a8a15a5] Changes were made to the re-auth feature in preview. (#523)
-
ExpirationBasedTokenManager
was renamed toBearerTokenManager
. -
BasicTokenManager
was added to handle password rotation.
-
- [ee7546f] Spatial type stringers now show actual field names. (#510)
- [39d4411] Backend improvements to support TestKit. (#520)
🆕 Features / Improvements
- [4147ce6] New logic to handle sub-millisecond transaction timeouts (#516).
-
[6964030] Documented Bolt logger usage for
ExecuteQuery
(#505).
🐛 Bug fixes
- [72512ea] Fixed error message when connecting to HTTP server (#517).
-
[5f36183] Add commented blank line to fix
Driver
deprecation notice (#506). - [69e574c] Added missing licence (#514).
- [9a195bf] TestKit: Temporarily skipped new tests that need fixes in the driver (#512).
🆕 Features / Improvements
- [94db034] Updated API documentation link.
- [0341d94] Prevent spurious logging on multiple Driver.Close().
-
[226f4b9] Added
bolt_agent
to theextra
dictionary of theHELLO
message.
💚 Special thanks to
for the detailed issues!
🐛 Bug fixes
-
[0eccfa3] Add missing
time.Time
type constraint for records and nodes/rels (see issue 486 for more context) - [5074923] Make sure transactions never returns connections to the pool twice (see issue 487 for more context)
- [bbb6f6d] Fix disabled level of notication min severity
🆕 Features / Improvements
- [fa344be] Docs: mention performance impact of notification filtering.
- [786866e] Expose a dictionary conversion method to records. Check out this example!
- [29a9396] Wake up connection borrowers when pool is closed (#489)
- [4f29cdc] Reduce number of logs around connection acquisition timeouts (#498)
- [e1b42c9] Gracefully return error when no callback defined for response (see issue 492 for more context)
- [a4ee117] Get rid of redundant onUnknown response handler callback (#499)
- [c01cd19] Update agent for upcoming release
This contains an important fix for re-authentication.
🆕 Features / Improvements
-
[4d3f387] Mention
NewDriverWithContext
does not do any connectivity work -
[cb75c31] Improve blocking borrow logic in pool
- This also ensures re-authorization occurs in all cases with connection re-use.
This release ships the long-requested re-authentication support (try it out and chime in) 🥳
ExecuteQuery
and BookmarkManager
are now Generally Available and out of preview!
🆕 Features / Improvements
-
[1f1c154]
⚠️ Deprecate driver config alias and update call sites- Please use
config.Config
instead ofneo4j.Config
- Please use
config.ServerAddressResolver
instead ofneo4j.ServerAddressResolver
- Please use
config.ServerAddress
instead ofneo4j.ServerAddress
- Please use
-
[c25cc31] Revisit retry logic (#465)
-
neo4j.IsRetryable
now more closely resembles the criteria used internally for when to retry transactions
-
-
[dec206f] Stabilize
ExecuteQuery
andBookmarkManager
APIs- Rename
neo4j.Writers
toWrite
andReaders
toRead
. - Rename
driver.DefaultExecuteQueryBookmarkManager()
todriver.ExecuteQueryBookmarkManager()
.
- Rename
-
[a9c87b9] Introduce re-authentication: auth rotation and session auth support (#467) (in preview)
- Allows for handling expiring authentication (backwards compatible) as well as session scoped authentication (requires neo4j server version 5.5+).
- We are actively looking for feedback: https://github.com/neo4j/neo4j-go-driver/discussions/482
-
[3f304ee] Feature
ExecuteQuery
in README - [c594f08] Bump default user agent to 5.8.0 (#480)
- [df4a6c1] Update server/driver compatibility (#481)
🆕 Features / Improvements
-
[fc2a1e0] Implement minimal support for Bolt 5.1
- it adds support for the new
LOGON
,LOGOFF
messages - [6aa0240] Introduce message queue to better correlate requests and responses
-
[deab2cd] Enable Bolt logger configuration for
ExecuteQuery
- this allows users to log Bolt messages exchanged between the driver and the Neo4j server, which is useful for troubleshooting
-
[a489aca] Show off
GetRecordValue
API in README example - [c9bec0c] Introduce notification filtering capability (see it in action)
- [ec2268f] Relabel experimental features as preview (see README for more explanation)
🐛 Bug fixes
-
[8667940] Fix
tfirst
tracking for interleaved runs of same transaction -
[94b10f6] Explicitly check for nil driver in
ExecuteQuery
- [efeb607] Close socket if Bolt handshake fails
This is a minor release with a couple of adjustments to neo4j.ExecuteQuery[T]
and documentation improvements.
🆕 Features / Improvements
-
[4ebfbdb] Allow
ResultTransformer
to return error at any stage- The 5.5.0 announcement's examples are updated.
-
[69b6d72] Pin
staticcheck
version- Used internally in CI. Change needed to keep working with Go 1.18 (baseline of the 5.x driver)
-
[9f981c1] Fix driver manual link
- Thanks @julienvey for the contribution!
📣 A brand new simplified API appears: welcome to neo4j.ExecuteQuery[T]
!
💪 A more robust approach to context termination has been implemented!
🆕 Features / Improvements
-
[8a53610] Clarify
ResultWithContext#Single
API docs - [70ed7ac] Update documented password to match new length requirements
- [8b9c4df] Let users override the minimum TLS version
- [c2ca69d] Introduce ExecuteQuery[T] - Follow this announcement for more details.
neo4j.ExecuteQuery
example
// error handling omitted for brevity
// note: you can implement your own ResultTransformer quite easily
eagerResult, _ := neo4j.ExecuteQuery(ctx, driver, "RETURN 42 AS answer", nil, neo4j.EagerResultTransformer)
fmt.Printf("keys: %v\n", eagerResult.Keys)
for _, record := range eagerResult.Records {
answer, _, _ := neo4j.GetRecordValue[int64](record, "answer")
fmt.Printf("result: %d\n", answer)
}
fmt.Printf("result available after: %s\n", eagerResult.Summary.ResultAvailableAfter().String())
- [23b666f] Warn of the impact of early context terminations
- [d463827] Remove read timeout log from critical section
- [b17318e] Improve docs of generic helpers
- [50a78df] Document current limitation with property values
🐛 Bug fixes
-
[78c1c75] Close underlying connection when context has terminated
This is super important and allows now to free the server from transactions that would otherwise sit idle. It is now also documented that early context termination hurt connection pooling in general, and degrade general application performance.
context.Context
is a nice but sharp tool!
A few wild generics helpers appear 🎉
🆕 Features / Improvements
-
[ad25e1a] Introduce transaction function generic API
neo4j.ExecuteWrite
andneo4j.ExecuteRead
neo4j.ExecuteWrite
example
// ⬇️ neo4j.ExecuteWrite[T] and neo4j.ExecuteRead[T] are now both available ⬇️
name, err := neo4j.ExecuteWrite[string](ctx, session, func(tx neo4j.ManagedTransaction) (string, error) {
result, err := tx.Run(ctx, "MATCH (person:Person {uuid: $uuid}) RETURN person LIMIT 1", map[string]any{"uuid": someUuid})
if err != nil {
return "", err
}
record, err := result.Single(ctx)
if err != nil {
return "", err
}
rawPerson, found := record.Get("person")
if !found {
return "", fmt.Errorf("no person found")
}
person, ok := rawPerson.(neo4j.Node)
if !ok {
return "", fmt.Errorf("invalid person: %v", rawPerson)
}
rawName, found := person.Props["name"]
if !found {
return "", fmt.Errorf("no name property found on person: %v", person)
}
name, ok := rawName.(string)
if !ok {
return "", fmt.Errorf("invalid name property: %v", rawName)
}
return name, nil
})
-
[14ef93a] Introduce generic
GetRecordValue
API
neo4j.GetRecordValue
(cont'd) example
name, err := neo4j.ExecuteWrite[string](ctx, session, func(tx neo4j.ManagedTransaction) (string, error) {
result, err := tx.Run(ctx, "MATCH (person:Person {uuid: $uuid}) RETURN person LIMIT 1",
map[string]any{"uuid": someUuid})
if err != nil {
return "", err
}
record, err := result.Single(ctx)
if err != nil {
return "", err
}
// ⬇️ same as before, just way shorter ⬇️
person, _, err := neo4j.GetRecordValue[neo4j.Node](record, "person")
if err != nil {
return "", fmt.Errorf("no person found")
}
rawName, found := person.Props["name"]
if !found {
return "", fmt.Errorf("no name property found on person: %v", person)
}
name, ok := rawName.(string)
if !ok {
return "", fmt.Errorf("invalid name property: %v", rawName)
}
return name, nil
})
-
[126edfb] Add generic
GetProperty
on nodes and relationships
neo4j.GetProperty
(cont'd) example
name, err := neo4j.ExecuteWrite[string](ctx, session, func(tx neo4j.ManagedTransaction) (string, error) {
result, err := tx.Run(ctx, "MATCH (person:Person {uuid: $uuid}) RETURN person LIMIT 1",
map[string]any{"uuid": someUuid})
if err != nil {
return "", err
}
record, err := result.Single(ctx)
if err != nil {
return "", err
}
person, _, err := neo4j.GetRecordValue[neo4j.Node](record, "person")
if err != nil {
return "", fmt.Errorf("no person found")
}
// ⬇️ same as before, just way shorter ⬇️
return neo4j.GetProperty[string](person, "name")
})
Less to write, less to read, more to enjoy!
🆕 Features / Improvements
- [576d8e0] Simplify the experimental Bookmark Manager API - It will no longer track bookmarks per database.
-
[1b6df2d] Improve documentation of
SessionConfig#Database
- TL;DR: always set the database at the session level if you can!
A minor release in all aspects.
- [f66f943] Update README with 5.0 examples and clearer instructions 📈
This release has the same content as 5.0.1.
This release does not contain any new user-facing features but improves documentation among other things.
- [6590ab1] Pin TestKit version
- [e4b6e09] Document issue with some code-generation based mocking libraries (read this)
- [cb7db9e] Update driver manual examples to leverage context-aware APIs
- [332277b] Integrate https://staticcheck.io/ and fix violations
5.0.0 is out, y'all! 🥳
go get github.com/neo4j/neo4j-go-driver/v5
This includes all of the previously mentioned changes and a couple more.
🆕 Features / Improvements
-
[a788d7c] Bookmark Manager APIs now expose
context.Context
and may return anerror
, to ease the interoperability with external data sources - [5e4eb9f] "pool closed" errors are now wrapped as usage error, since this is likely a sign of a closed session being used
This is the first candidate release for 5.0.0 and the first release to support the 5.0 protocol.
go get github.com/neo4j/neo4j-go-driver/v5@v5.0.0-alpha1
The driver is now 100% dependency-free and has a hard Go 1.18 baseline.
As a reminder, the Go driver officially supports only actively maintained Go versions (see Go maintenance policy here).
It includes all changes listed in v5.0.0-preview
as well as the following changes.
🆕 Features / Improvements
-
[9a8de1d] support Bolt protocol version 5.0
⚠️ Deprecated Nodes' and Relationships'Id
property (Int64
) in favor ofElementId
(string
). -
[2d1525a] introduce
IsEncrypted
driver API. This is based on the configured URI scheme used to instantiate the driver. -
[31500b8] expose the whole
tls.Config
inConfig
-
[65604b0] expose
neo4j.IsRetryable(error)
to allow users to roll out their own retry logic -
[88a7cd7] introduce
GetServerInfo
driver API - introduce
Peek
/PeekRecord
/IsOpen
toResultWithContext
- [abc9e83] support new UTC DateTime Bolt structures
- introduce
neo4j.BookmarkManager
to centralize notifications of managed bookmarks and supply of custom ones. This is configured at the session level and is an experimental API. -
[6bcfac0] calling
Rollback
is not necessary anymore when a run fails
💥 Breaking changes
-
[4c74525] introduce
PeekRecord
toResult
- [6bcfac0] a transaction timeout of 0 (which is not the default value anymore) now disables the timeout on the server side
- [285270b] [behavioral] authentication errors do not cause retries of transaction function executions anymore
-
[6bcfac0] [behavioral] calling
Rollback
orCommit
multiple times is now prohibited - [c7672f8] [behavioral] transaction begin message is now eagerly sent
-
[727a67b] [behavioral]
VerifyConnectivity
now relies onGetServerInfo
instead of a Cypher query
🐛 Bug fixes
- [ab6defa] exponential back-off now slows down instead of speeding up 😅
- [7b2399d] return connection to pool upon transaction function panics
💡 Replace v4 imports with v5. For a new project, run:
go get github.com/neo4j/neo4j-go-driver/v5@v5.0.0-preview
🆕 Features
-
[#72] This has been long requested. The driver now exposes a set of APIs that take user-provided instances of
context.Context
into account. The entry point isneo4j.NewDriverWithContext
. The existing APIs are unchanged but deprecated and planned for removal in 6.0.
💥 Breaking changes
- all deprecated elements in 4.4 have been removed
- all the following previously exported types are now internal:
-
db.AccessMode
,db.WriteMode
anddb.ReadMode
(use the existingneo4j.AccessMode
,neo4j.AccessModeWrite
andneo4j.AccessModeRead
instead) -
db.TxHandle
(no replacement) -
db.StreamHandle
(no replacement) -
db.Command
(no replacement) -
db.TxConfig
(use the existingneo4j.TransactionConfig
instead) -
db.Connection
(no replacement) -
db.RoutingTable
(no replacement) -
db.DefaultDatabase
(no replacement) -
db.DatabaseSelector
(no replacement)
-
If you disagree with some of these changes, please open an issue and let's discuss your use case.
👋 Deprecations
-
[#302] Deprecate
Session.LastBookmark()
forSession.LastBookmarks()
- As mentioned earlier, all APIs accessible through the
neo4j.NewDriver
function are now deprecated (including that function) and will be removed in 6.0