currentRow method

List currentRow([
  1. bool useBigInt = false
])

Reads the current from the underlying js api

Implementation

List<dynamic> currentRow([bool useBigInt = false]) {
  if (useBigInt) {
    final result =
        _obj.get(null, _SqlJsStatementGetOptions(useBigInt: true)).toDart;
    final dartResult = <Object?>[];

    for (var i = 0; i < result.length; i++) {
      if (result[i].typeofEquals('bigint')) {
        final toString =
            (result[i] as JSObject).callMethod<JSString>('toString'.toJS);
        dartResult.add(BigInt.parse(toString.toDart));
      } else {
        dartResult.add(result[i].dartify());
      }
    }
    return dartResult;
  } else {
    return _obj.get(null, null).dartify() as List;
  }
}