commit abstract method

Future<CommitResult> commit({
  1. List<Entity> inserts,
  2. List<Entity> autoIdInserts,
  3. List<Key> deletes,
  4. Transaction transaction,
})

Make modifications to the datastore.

  • inserts are Entitys which have a fully populated Key and should be either added to the datastore or updated.

  • autoIdInserts are Entitys which do not have a fully populated Key and should be added to the dataset, automatically assigning integer IDs. The returned CommitResult will contain the fully populated keys.

  • deletes are a list of fully populated Keys which uniquely identify the Entitys which should be deleted.

If a transaction is given, all modifications will be done within that transaction.

This method might complete with a TransactionAbortedError error. Users must take care of retrying transactions.

Implementation

// TODO(Issue #6): Consider splitting `inserts` into insert/update/upsert.
Future<CommitResult> commit(
    {List<Entity> inserts,
    List<Entity> autoIdInserts,
    List<Key> deletes,
    Transaction transaction});