W3cubDocs

/Dart 2

transaction method

Transaction transaction (dynamic storeName_OR_storeNames, String mode)

Implementation

Transaction transaction(storeName_OR_storeNames, String mode) {
  if (mode != 'readonly' && mode != 'readwrite') {
    throw new ArgumentError(mode);
  }

  // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
  // and copy to JavaScript array if necessary.

  // Try and create a transaction with a string mode.  Browsers that expect a
  // numeric mode tend to convert the string into a number.  This fails
  // silently, resulting in zero ('readonly').
  return _transaction(storeName_OR_storeNames, mode);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-indexed_db/Database/transaction.html