SQL row metadata if rows exist in the result; otherwise null.
The number of rows updated by the statement or -1
if this result is a row set.
Releases the resources associated with the query result.
The query engine delivers the rows asynchronously. The query may become inactive even before all rows are consumed. The invocation of this command will cancel the execution of the query on all members if the query is still active. Otherwise it is no-op. For a result with an update count it is always no-op.
Return whether this result has rows to iterate. False if update count is returned, true if rows are returned.
whether this result is a row set
Returns next SqlRowType iteration result. You should not call this method when result does not contain rows.
an object including value
and done
keys. The done
key indicates if
iteration is ended, i.e when there are no more results. value
holds iteration values which are in SqlRowType type.
value
has undefined value if iteration has ended.
Generated using TypeDoc
SQL query result. Depending on the statement type it represents a stream of rows or an update count.
Iteration
An
SqlResult
is an async iterable of SqlRowType which is either an SqlRow or regular JavaScript objects. By default it returns regular JavaScript objects, containing key and values. Keys represent column names, whereas values represent row values. The default object returning behavior can be changed via the option SqlStatementOptions.returnRawResult. If it is true, SqlRow objects are returned instead of regular objects.Values in SQL rows are deserialized lazily. While iterating you will get a HazelcastSqlException if a value in SQL row cannot be deserialized.
Use close to release the resources associated with the result.
An
SqlResult
can be iterated only once.for-await... of
Refer to for-await... of page for more information.
next()
Another approach of iterating rows is using the next method. Every call to
next
returns an object withdone
andvalue
properties.done
isfalse
when there are more rows to iterate,true
otherwise.value
holds the current row value. Refer to iterators for more information about iteration in JavaScript.Usage for update count
You don't need to call close in this case.