runStatementAndEncodeResults function

JSObject runStatementAndEncodeResults(
  1. CommonPreparedStatement statement,
  2. DecodedTypedValues parameters
)

Steps through the statement, encoding each row as a JavaScript value that can later be deserialized with deserializeResultSet.

This correctly preserves type information for numeric values. For example, a double 3.0 would be encoded differently than the int 3, allowing clients where those values are non-identical (i.e., dart2wasm) to tell them apart.

Implementation

JSObject runStatementAndEncodeResults(
  CommonPreparedStatement statement,
  DecodedTypedValues parameters,
) {
  return RowsResponseUtils.iterateAndEncodeResults(statement, parameters);
}