You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src_js/connection.js
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,10 @@ class Connection {
84
84
* Execute a prepared statement with the given parameters.
85
85
* @param {kuzu.PreparedStatement} preparedStatement the prepared statement to execute.
86
86
* @param {Object} params a plain object mapping parameter names to values.
87
+
* @param {Function} [progressCallback] optional callback function that is invoked with the progress of the query execution. The callback receives three arguments: pipelineProgress, numPipelinesFinished, and numPipelines.
87
88
* @returns {Promise<kuzu.QueryResult>} a promise that resolves to the query result. The promise is rejected if there is an error.
returnreject(newError("progressCallback must be a function."));
132
136
}
133
137
this._getConnection()
134
138
.then((connection)=>{
@@ -149,7 +153,8 @@ class Connection {
149
153
.catch((err)=>{
150
154
returnreject(err);
151
155
});
152
-
}
156
+
},
157
+
progressCallback
153
158
);
154
159
}catch(e){
155
160
returnreject(e);
@@ -193,13 +198,17 @@ class Connection {
193
198
/**
194
199
* Execute a query.
195
200
* @param {String} statement the statement to execute.
201
+
* @param {Function} [progressCallback] - Optional callback function that is invoked with the progress of the query execution. The callback receives three arguments: pipelineProgress, numPipelinesFinished, and numPipelines.
196
202
* @returns {Promise<kuzu.QueryResult>} a promise that resolves to the query result. The promise is rejected if there is an error.
197
203
*/
198
-
query(statement){
204
+
query(statement,progressCallback){
199
205
returnnewPromise((resolve,reject)=>{
200
206
if(typeofstatement!=="string"){
201
207
returnreject(newError("statement must be a string."));
0 commit comments