Transaction class base

Accumulates edits to the mapping table in a memory buffer.

This class accumulates a batch of edits to the key-value store of the database (the mapping table). The edits are not written to the database and remain in an in-memory buffer within this class until the SQLite.apply method is called. The buffer holds only Object references to inserted and updated JSON values; their transformation into a textual JSON representation occurs in SQLite.apply.

JSON values passed to insert and update are expected to be directly encodable to JSON strings (i.e., jsonEncode should be able to encode the value without calling either toEncodable or toJson). If a JSON value cannot be converted to a textual form, then SQLite.apply will roll back its Transaction batch and throw a FormatException.

Annotations
  • @immutable

Constructors

Transaction()

Properties

hashCode → int
The hash code for this object.
no setterinherited
length → int
The number of edits accumulated in the memory buffer.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(SqlId id) → void
Adds a delete edit to the memory buffer.
insert(KeyId id, Object value) → void
Adds an insert edit to the memory buffer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
update(SqlId id, Object value) → void
Adds an update edit to the memory buffer.

Operators

operator ==(Object other) → bool
The equality operator.
inherited