@@ -26,7 +26,7 @@ import { assertString } from './util'
26
26
const INIT = 0x01 // 0000 0001 // INIT <user_agent> <authentication_token>
27
27
const ACK_FAILURE = 0x0e // 0000 1110 // ACK_FAILURE - unused
28
28
const RESET = 0x0f // 0000 1111 // RESET
29
- const RUN = 0x10 // 0001 0000 // RUN <statement > <parameters>
29
+ const RUN = 0x10 // 0001 0000 // RUN <query > <parameters>
30
30
const DISCARD_ALL = 0x2f // 0010 1111 // DISCARD_ALL - unused
31
31
const PULL_ALL = 0x3f // 0011 1111 // PULL_ALL
32
32
@@ -68,15 +68,15 @@ export default class RequestMessage {
68
68
69
69
/**
70
70
* Create a new RUN message.
71
- * @param {string } statement the cypher statement .
72
- * @param {Object } parameters the statement parameters.
71
+ * @param {string } query the cypher query .
72
+ * @param {Object } parameters the query parameters.
73
73
* @return {RequestMessage } new RUN message.
74
74
*/
75
- static run ( statement , parameters ) {
75
+ static run ( query , parameters ) {
76
76
return new RequestMessage (
77
77
RUN ,
78
- [ statement , parameters ] ,
79
- ( ) => `RUN ${ statement } ${ JSON . stringify ( parameters ) } `
78
+ [ query , parameters ] ,
79
+ ( ) => `RUN ${ query } ${ JSON . stringify ( parameters ) } `
80
80
)
81
81
}
82
82
@@ -146,27 +146,25 @@ export default class RequestMessage {
146
146
147
147
/**
148
148
* Create a new RUN message with additional metadata.
149
- * @param {string } statement the cypher statement .
150
- * @param {Object } parameters the statement parameters.
149
+ * @param {string } query the cypher query .
150
+ * @param {Object } parameters the query parameters.
151
151
* @param {Bookmark } bookmark the bookmark.
152
152
* @param {TxConfig } txConfig the configuration.
153
153
* @param {string } database the database name.
154
154
* @param {string } mode the access mode.
155
155
* @return {RequestMessage } new RUN message with additional metadata.
156
156
*/
157
157
static runWithMetadata (
158
- statement ,
158
+ query ,
159
159
parameters ,
160
160
{ bookmark, txConfig, database, mode } = { }
161
161
) {
162
162
const metadata = buildTxMetadata ( bookmark , txConfig , database , mode )
163
163
return new RequestMessage (
164
164
RUN ,
165
- [ statement , parameters , metadata ] ,
165
+ [ query , parameters , metadata ] ,
166
166
( ) =>
167
- `RUN ${ statement } ${ JSON . stringify ( parameters ) } ${ JSON . stringify (
168
- metadata
169
- ) } `
167
+ `RUN ${ query } ${ JSON . stringify ( parameters ) } ${ JSON . stringify ( metadata ) } `
170
168
)
171
169
}
172
170
@@ -239,7 +237,7 @@ function buildTxMetadata (bookmark, txConfig, database, mode) {
239
237
240
238
/**
241
239
* Create an object that represents streaming metadata.
242
- * @param {Integer|number } stmtId The statement id to stream its results.
240
+ * @param {Integer|number } stmtId The query id to stream its results.
243
241
* @param {Integer|number } n The number of records to stream.
244
242
* @returns {Object } a metadata object.
245
243
*/
0 commit comments