DVDatabaseMeterStore class
Records in the application's own database, through DV.Database.
Instances share it, which is what makes a tenant's total one number rather than one per process. On a database that enforces constraints, a retry racing its original onto two instances is refused by the unique key rather than counted twice.
- Implemented types
Constructors
- DVDatabaseMeterStore({String table = 'dv_meter_records'})
Properties
Methods
-
add(
DVMeterRecord record) → Future< bool> -
Stores
record. Returns false when the store itself refused it as a duplicate, which a database does when two instances race.override -
hasKey(
{required String tenant, required String meter, required String key, required Iterable< DVMeterPeriod> periods}) → Future<bool> -
Whether a record with
keyexists fortenantandmeterin any ofperiods.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordsIn(
{required String tenant, required String meter, required DVMeterPeriod period}) → Future< List< DVMeterRecord> > -
The records counted in
periodfortenantandmeter.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited