Skip to content

Commit

Permalink
Clarify FetchAll behavior inline docs (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-ottolenghi authored Jul 22, 2024
1 parent 14cbf69 commit a8c8342
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 6 additions & 7 deletions neo4j/config/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,14 @@ type Config struct {
// FetchSize defines how many records to pull from server in each batch.
// From Bolt protocol v4 (Neo4j 4+) records can be fetched in batches as
// compared to fetching all in previous versions.
// If the underlying protocol does not support FetchSize, it is ignored.
//
// If FetchSize is set to FetchDefault, the driver decides the appropriate
// size. If set to a positive value that size is used if the underlying
// protocol supports it otherwise it is ignored.
// If FetchSize is set to `FetchDefault`, the driver decides the appropriate size.
// If set to a positive value that size is used; negative values behaves as `FetchAll` (see below).
//
// To turn off fetching in batches and always fetch everything, set
// FetchSize to FetchAll.
// If a single large result is to be retrieved, this is the most performant
// setting.
// To turn off fetching in batches and always fetch everything, set FetchSize to `FetchAll`.
// A limited FetchSize ensures the client is not overflown with records,
// and allows to bound memory usage.
FetchSize int
// NotificationsMinSeverity defines the minimum severity level of notifications the server should send.
// By default, the server's settings are used.
Expand Down
14 changes: 8 additions & 6 deletions neo4j/session_with_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ type SessionConfig struct {
// For older Bolt protocol versions, the behavior is the same as described for the bolt schemes above.
DatabaseName string
// FetchSize defines how many records to pull from server in each batch.
// From Bolt protocol v4 (Neo4j 4+) records can be fetched in batches as compared to fetching
// all in previous versions.
// From Bolt protocol v4 (Neo4j 4+) records can be fetched in batches as
// compared to fetching all in previous versions.
// If the underlying protocol does not support FetchSize, it is ignored.
//
// If FetchSize is set to FetchDefault, the driver decides the appropriate size. If set to a positive value
// that size is used if the underlying protocol supports it otherwise it is ignored.
// If FetchSize is set to `FetchDefault`, the driver decides the appropriate size.
// If set to a positive value that size is used; negative values behaves as `FetchAll` (see below).
//
// To turn off fetching in batches and always fetch everything, set FetchSize to FetchAll.
// If a single large result is to be retrieved this is the most performant setting.
// To turn off fetching in batches and always fetch everything, set FetchSize to `FetchAll`.
// A limited FetchSize ensures the client is not overflown with records,
// and allows to bound memory usage.
FetchSize int
// Logging target the session will send its Bolt message traces
//
Expand Down

0 comments on commit a8c8342

Please sign in to comment.