Skip to content
Stephen Cathcart edited this page Aug 29, 2024 · 95 revisions

v5.24.0

🆕 Features / Improvements

  • [6ecad42] Add SCHEMA notification category (#594)
  • [778d6ba] Pre-commit hook: fix staticcheck version selection by go version (#595)

v5.23.1

💚 Special thanks to

🐛 Bug fixes

  • [190a74b] Fix hydrator path overflow bug (#592)

v5.23.0

🆕 Features / Improvements

  • [f49845b] Add GqlStatusObject support as notifications to ResultSummary (ℹ️ in preview). (#588)
  • [14cbf69] Significant performance improvement through buffered reading. (#581)
  • [a8c8342] Clarify FetchAll behavior inline docs (#586)

v5.22.0

This release contains no significant changes or new features.


v5.21.0

🆕 Features / Improvements

  • [7772a81] Updated name of skipped Testkit test due to upcoming GqlStatusObject work. (#585)
  • [8836143] Disabled flakey stress test. (#585)

v5.20.0

This release contains no significant changes or new features.


v5.19.0

🆕 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)

v5.18.0

💚 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 a UsageError. 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".

v5.17.0

🆕 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)

v5.16.0

🆕 Features / Improvements

  • [4354f3a] Added ExecuteQueryWithTransactionConfig option for ExecuteQuery (#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)

v5.15.0

💚 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)

v5.14.0

💚 Special thanks to

🆕 Features / Improvements

  • [56358bd] Released Re-Auth and AuthTokenManager (#542)
  • [ede36d4] Added new Notifications (#537)

🐛 Bug fixes

  • [16b4b5f] Closed channel instead of sending empty struct to signal update of the routing table (#540)

v5.13.0

🆕 Features / Improvements

  • [54efcda] Added Bolt 5.4 support and Telemetry API. (#533)
  • [7d6cead] Improved transaction timeout documentation. (#531)

v5.12.0

🆕 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 to BearerTokenManager.
    • BasicTokenManager was added to handle password rotation.
  • [ee7546f] Spatial type stringers now show actual field names. (#510)
  • [39d4411] Backend improvements to support TestKit. (#520)

v5.11.0

🆕 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).

v5.10.0

🆕 Features / Improvements

  • [94db034] Updated API documentation link.
  • [0341d94] Prevent spurious logging on multiple Driver.Close().
  • [226f4b9] Added bolt_agent to the extra dictionary of the HELLO message.

v5.9.0

💚 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

v5.8.1

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.

v5.8.0

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 of neo4j.Config
    • Please use config.ServerAddressResolver instead of neo4j.ServerAddressResolver
    • Please use config.ServerAddress instead of neo4j.ServerAddress
  • [c25cc31] Revisit retry logic (#465)
    • neo4j.IsRetryable now more closely resembles the criteria used internally for when to retry transactions
  • [dec206f] Stabilize ExecuteQuery and BookmarkManager APIs
    • Rename neo4j.Writers to Write and Readers to Read.
    • Rename driver.DefaultExecuteQueryBookmarkManager() to driver.ExecuteQueryBookmarkManager().
  • [a9c87b9] Introduce re-authentication: auth rotation and session auth support (#467) (in preview)
  • [3f304ee] Feature ExecuteQuery in README
  • [c594f08] Bump default user agent to 5.8.0 (#480)
  • [df4a6c1] Update server/driver compatibility (#481)

v5.7.0

🆕 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

v5.6.0

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!

v5.5.0

📣 A brand new simplified API appears: welcome to neo4j.ExecuteQuery[T]!

💪 A more robust approach to context termination has been implemented!

🆕 Features / Improvements

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!


v5.4.0

A few wild generics helpers appear 🎉

🆕 Features / Improvements

  • [ad25e1a] Introduce transaction function generic API neo4j.ExecuteWrite and neo4j.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!


v5.3.0

🆕 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!

v5.2.0

A minor release in all aspects.

  • [f66f943] Update README with 5.0 examples and clearer instructions 📈

v5.1.0

This release has the same content as 5.0.1.

Spiderman pointing fingers to another Spiderman (and vice-versa)

v5.0.1

This release does not contain any new user-facing features but improves documentation among other things.


v5.0.0

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 an error, 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

v5.0.0-alpha1

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 of ElementId (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 in Config
  • [65604b0] expose neo4j.IsRetryable(error) to allow users to roll out their own retry logic
  • [88a7cd7] introduce GetServerInfo driver API
  • introduce Peek / PeekRecord / IsOpen to ResultWithContext
  • [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 to Result
  • [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 or Commit multiple times is now prohibited
  • [c7672f8] [behavioral] transaction begin message is now eagerly sent
  • [727a67b] [behavioral] VerifyConnectivity now relies on GetServerInfo 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

v5.0.0-preview

⚠️ This is an experimental release. It may completely change in the future. It does not contain any connectivity to Neo4j 5.0. In other words, this is equivalent to the Go driver 4.4.x driver with a few changes detailed below.

💡 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 is neo4j.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 and db.ReadMode (use the existing neo4j.AccessMode, neo4j.AccessModeWrite and neo4j.AccessModeRead instead)
    • db.TxHandle (no replacement)
    • db.StreamHandle (no replacement)
    • db.Command (no replacement)
    • db.TxConfig (use the existing neo4j.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() for Session.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