new QueryResult(connection, queryResult)
Internal constructor. Use `Connection.query` or `Connection.execute`
to get a `QueryResult` object.
Parameters:
Name | Type | Description |
---|---|---|
connection |
Connection | the connection object. |
queryResult |
KuzuNative.NodeQueryResult | the native query result object. |
- Source:
Methods
_checkClosed()
Internal function to check if the query result is closed.
- Source:
Throws:
-
if the query result is closed.
- Type
- Error
all(resultCallback, errorCallback)
Get all rows of the query result with callback functions.
Parameters:
Name | Type | Description |
---|---|---|
resultCallback |
function | the callback function that is called with all rows of the query result. |
errorCallback |
function | the callback function that is called when there is an error. |
- Source:
close()
Close the query result.
- Source:
each(resultCallback, doneCallback, errorCallback)
Iterate through the query result with callback functions.
Parameters:
Name | Type | Description |
---|---|---|
resultCallback |
function | the callback function that is called for each row of the query result. |
doneCallback |
function | the callback function that is called when the iteration is done. |
errorCallback |
function | the callback function that is called when there is an error. |
- Source:
(async) getAll() → {Promise.<Array.<Object>>}
Get all rows of the query result.
- Source:
Returns:
a promise that resolves to all rows of the query result. The promise is rejected if there is an error.
- Type
- Promise.<Array.<Object>>
getColumnDataTypes() → {Promise.<Array.<String>>}
Get the data types of the columns of the query result.
- Source:
Returns:
a promise that resolves to the data types of the columns of the query result. The promise is rejected if there is an error.
- Type
- Promise.<Array.<String>>
getColumnNames() → {Promise.<Array.<String>>}
Get the names of the columns of the query result.
- Source:
Returns:
a promise that resolves to the names of the columns of the query result. The promise is rejected if there is an error.
- Type
- Promise.<Array.<String>>
getNext() → {Promise.<Object>}
Get the next row of the query result.
- Source:
Returns:
a promise that resolves to the next row of the query result. The promise is rejected if there is an error.
- Type
- Promise.<Object>
getNumTuples() → {Number}
Get the number of rows of the query result.
- Source:
Returns:
the number of rows of the query result.
- Type
- Number
hasNext() → {Boolean}
Check if the query result has more rows.
- Source:
Returns:
true if the query result has more rows.
- Type
- Boolean
resetIterator()
Reset the iterator of the query result to the beginning.
This function is useful if the query result is iterated multiple times.
- Source: