@@ -253,7 +253,6 @@ class SessionConfig {
253
253
* await linkedSession2.close()
254
254
* await unlinkedSession.close()
255
255
*
256
- * @experimental
257
256
* @type {BookmarkManager|undefined }
258
257
* @since 5.0
259
258
*/
@@ -325,30 +324,28 @@ class SessionConfig {
325
324
}
326
325
}
327
326
328
- type RoutingControl = 'WRITERS ' | 'READERS '
329
- const WRITERS : RoutingControl = 'WRITERS '
330
- const READERS : RoutingControl = 'READERS '
327
+ type RoutingControl = 'WRITE ' | 'READ '
328
+ const ROUTING_WRITE : RoutingControl = 'WRITE '
329
+ const ROUTING_READ : RoutingControl = 'READ '
331
330
/**
332
- * @typedef {'WRITERS '|'READERS ' } RoutingControl
331
+ * @typedef {'WRITE '|'READ ' } RoutingControl
333
332
*/
334
333
/**
335
334
* Constants that represents routing modes.
336
335
*
337
336
* @example
338
- * driver.executeQuery("<QUERY>", <PARAMETERS>, { routing: neo4j.routing.WRITERS })
337
+ * driver.executeQuery("<QUERY>", <PARAMETERS>, { routing: neo4j.routing.WRITE })
339
338
*/
340
339
const routing = {
341
- WRITERS ,
342
- READERS
340
+ WRITE : ROUTING_WRITE ,
341
+ READ : ROUTING_READ
343
342
}
344
343
345
344
Object . freeze ( routing )
346
345
347
346
/**
348
347
* The query configuration
349
348
* @interface
350
- * @experimental This can be changed or removed anytime.
351
- * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
352
349
*/
353
350
class QueryConfig < T = EagerResult > {
354
351
routing ?: RoutingControl
@@ -367,7 +364,7 @@ class QueryConfig<T = EagerResult> {
367
364
*
368
365
* @type {RoutingControl }
369
366
*/
370
- this . routing = routing . WRITERS
367
+ this . routing = routing . WRITE
371
368
372
369
/**
373
370
* Define the transformation will be applied to the Result before return from the
@@ -398,7 +395,7 @@ class QueryConfig<T = EagerResult> {
398
395
* A BookmarkManager is a piece of software responsible for keeping casual consistency between different pieces of work by sharing bookmarks
399
396
* between the them.
400
397
*
401
- * By default, it uses the driver's non mutable driver level bookmark manager. See, {@link Driver.defaultExecuteQueryBookmarkManager }
398
+ * By default, it uses the driver's non mutable driver level bookmark manager. See, {@link Driver.executeQueryBookmarkManager }
402
399
*
403
400
* Can be set to null to disable causal chaining.
404
401
* @type {BookmarkManager|null }
@@ -472,11 +469,9 @@ class Driver {
472
469
/**
473
470
* The bookmark managed used by {@link Driver.executeQuery}
474
471
*
475
- * @experimental This can be changed or removed anytime.
476
472
* @type {BookmarkManager }
477
- * @returns {BookmarkManager }
478
473
*/
479
- get defaultExecuteQueryBookmarkManager ( ) : BookmarkManager {
474
+ get executeQueryBookmarkManager ( ) : BookmarkManager {
480
475
return this . _defaultExecuteQueryBookmarkManager
481
476
}
482
477
@@ -498,7 +493,7 @@ class Driver {
498
493
* const { keys, records, summary } = await driver.executeQuery(
499
494
* 'MATCH (p:Person{ name: $name }) RETURN p',
500
495
* { name: 'Person1'},
501
- * { routing: neo4j.routing.READERS })
496
+ * { routing: neo4j.routing.READ })
502
497
*
503
498
* @example
504
499
* // Run a read query returning a Person Nodes per elementId
@@ -526,7 +521,7 @@ class Driver {
526
521
* "<QUERY>",
527
522
* <PARAMETERS>,
528
523
* {
529
- * routing: neo4j.routing.WRITERS ,
524
+ * routing: neo4j.routing.WRITE ,
530
525
* resultTransformer: transformer,
531
526
* database: "<DATABASE>",
532
527
* impersonatedUser: "<USER>",
@@ -549,21 +544,19 @@ class Driver {
549
544
* }
550
545
*
551
546
* @public
552
- * @experimental This can be changed or removed anytime.
553
547
* @param {string | {text: string, parameters?: object} } query - Cypher query to execute
554
548
* @param {Object } parameters - Map with parameters to use in the query
555
549
* @param {QueryConfig<T> } config - The query configuration
556
550
* @returns {Promise<T> }
557
551
*
558
552
* @see {@link resultTransformers } for provided result transformers.
559
- * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
560
553
*/
561
554
async executeQuery < T = EagerResult > ( query : Query , parameters ?: any , config : QueryConfig < T > = { } ) : Promise < T > {
562
- const bookmarkManager = config . bookmarkManager === null ? undefined : ( config . bookmarkManager ?? this . defaultExecuteQueryBookmarkManager )
555
+ const bookmarkManager = config . bookmarkManager === null ? undefined : ( config . bookmarkManager ?? this . executeQueryBookmarkManager )
563
556
const resultTransformer = ( config . resultTransformer ?? resultTransformers . eagerResultTransformer ( ) ) as ResultTransformer < T >
564
- const routingConfig : string = config . routing ?? routing . WRITERS
557
+ const routingConfig : string = config . routing ?? routing . WRITE
565
558
566
- if ( routingConfig !== routing . READERS && routingConfig !== routing . WRITERS ) {
559
+ if ( routingConfig !== routing . READ && routingConfig !== routing . WRITE ) {
567
560
throw newError ( `Illegal query routing config: "${ routingConfig } "` )
568
561
}
569
562
0 commit comments