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

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
table → String
final

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 key exists for tenant and meter in any of periods.
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 period for tenant and meter.
override
toString() → String
A string representation of this object.
inherited

Operators

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