@@ -472,29 +472,29 @@ func (d *driverWithContext) VerifyAuthentication(ctx context.Context, auth *Auth
472
472
// the built-in callback neo4j.ExecuteQueryWithBookmarkManager.
473
473
// You can disable bookmark management by passing the neo4j.ExecuteQueryWithoutBookmarkManager callback to ExecuteQuery.
474
474
//
475
- // The equivalent functionality of ExecuteQuery can be replicated with pre-existing APIs as follows:
475
+ // The equivalent functionality of ExecuteQuery can be replicated with sessions and transaction functions as follows:
476
476
//
477
- // // all the error handling bits have been omitted for brevity (do not do this in production!)
478
- // session := driver.NewSession(ctx, neo4j.SessionConfig{
479
- // DatabaseName: "<DATABASE>",
480
- // ImpersonatedUser: "<USER>",
481
- // BookmarkManager: bookmarkManager,
482
- // })
483
- // defer handleClose(ctx, session)
484
- // // session.ExecuteRead is called if the routing is set to neo4j.Read
485
- // result, _ := session.ExecuteWrite(ctx, func(tx neo4j.ManagedTransaction) (any, error) {
486
- // result, _ := tx.Run(ctx, "<CYPHER>", parameters)
487
- // records, _ := result.Collect(ctx) // real implementation does not use Collect
488
- // keys, _ := result.Keys()
489
- // summary, _ := result.Consume(ctx)
490
- // return &neo4j.EagerResult{
491
- // Keys: keys,
492
- // Records: records,
493
- // Summary: summary,
494
- // }, nil
495
- // })
496
- // eagerResult := result.(*neo4j.EagerResult)
497
- // // do something with eagerResult
477
+ // // all the error handling bits have been omitted for brevity (do not do this in production!)
478
+ // session := driver.NewSession(ctx, neo4j.SessionConfig{
479
+ // DatabaseName: "<DATABASE>",
480
+ // ImpersonatedUser: "<USER>",
481
+ // BookmarkManager: bookmarkManager,
482
+ // })
483
+ // defer handleClose(ctx, session)
484
+ // // session.ExecuteRead is called if the routing is set to neo4j.Read
485
+ // result, _ := session.ExecuteWrite(ctx, func(tx neo4j.ManagedTransaction) (any, error) {
486
+ // result, _ := tx.Run(ctx, "<CYPHER>", parameters)
487
+ // records, _ := result.Collect(ctx) // real implementation does not use Collect
488
+ // keys, _ := result.Keys()
489
+ // summary, _ := result.Consume(ctx)
490
+ // return &neo4j.EagerResult{
491
+ // Keys: keys,
492
+ // Records: records,
493
+ // Summary: summary,
494
+ // }, nil
495
+ // })
496
+ // eagerResult := result.(*neo4j.EagerResult)
497
+ // // do something with eagerResult
498
498
//
499
499
// The available ResultTransformer implementation, EagerResultTransformer, computes an *EagerResult.
500
500
// As the latter's name suggests, this is not optimal when the result is made from a large number of records.
@@ -672,7 +672,6 @@ func ExecuteQueryWithTransactionConfig(configurers ...func(*TransactionConfig))
672
672
}
673
673
}
674
674
675
-
676
675
// ExecuteQueryWithAuthToken configures neo4j.ExecuteQuery to overwrite the AuthToken for the session.
677
676
func ExecuteQueryWithAuthToken (auth AuthToken ) ExecuteQueryConfigurationOption {
678
677
return func (configuration * ExecuteQueryConfiguration ) {
0 commit comments