Transaction class
A datastore transaction.
It can be used for making lookups/queries and queue modifications (inserts/updates/deletes). Finally the transaction can be either committed or rolled back.
Constructors
- Transaction(DatastoreDB db, Transaction _datastoreTransaction)
Properties
- db → DatastoreDB
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
commit(
) → Future - Commits this transaction including all of the queued mutations.
-
lookup<
T extends Model> (List< Key> keys) → Future<List< T?> > -
Looks up
keys
within this transaction. -
lookupOrNull<
T extends Model> (Key key) → Future< T?> -
Looks up a single
key
in the datastore, and returns the associated Model object. -
lookupValue<
T extends Model> (Key key, {T orElse()?}) → Future< T> -
Looks up a single
key
within this transaction, and returns the associated Model object. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query<
T extends Model> (Key ancestorKey, {Partition? partition}) → Query< T> -
Query for
kind
models withancestorKey
. -
queueMutations(
{List< Model> ? inserts, List<Key> ? deletes}) → void -
Enqueues
inserts
anddeletes
which should be committed at commit time. -
rollback(
) → Future - Rolls this transaction back.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited