sdb/sdb library

Simple DB.

Opinionated strong type API. Design around indexed db API which is a basic database API easy to implement with good web support and robust desktop implementation using idb_sqflite

In memory available (mainly for testing) and io implementation using sembast

Classes

SdbBoundaries<T extends Object>
Lower and upper boundaries.
SdbBoundary<T extends Object>
Simple boundary definition. include default to true for lower boundary and false for upper boundary.
SdbDatabase
SimpleDb definition.
SdbFactory
Sdb Factory
SdbIndex1Ref<K extends KeyBase, V extends ValueBase, I extends IndexBase>
Index on 1 field
SdbIndex2Ref<K extends KeyBase, V extends ValueBase, I1 extends IndexBase, I2 extends IndexBase>
Index on 2 fields
SdbIndex3Ref<K extends KeyBase, V extends ValueBase, I1 extends IndexBase, I2 extends IndexBase, I3 extends IndexBase>
Index on 3 fields
SdbIndex4Ref<K extends KeyBase, V extends ValueBase, I1 extends IndexBase, I2 extends IndexBase, I3 extends IndexBase, I4 extends IndexBase>
Index on 4 fields
SdbIndexRecordKey<K extends KeyBase, V extends ValueBase, I extends IndexBase>
Index record key.
SdbIndexRecordRef<K extends KeyBase, V extends ValueBase, I extends IndexBase>
Index record reference.
SdbIndexRecordSnapshot<K extends KeyBase, V extends ValueBase, I extends IndexBase>
Index record snapshot.
SdbIndexRef<K extends KeyBase, V extends ValueBase, I extends IndexBase>
Index reference.
SdbLowerBoundary<T extends Object>
Lower boundary. (included by default).
SdbMultiStoreTransaction
Multi-store transaction.
SdbOpenDatabase
Database during open.
SdbOpenStoreRef<K extends KeyBase, V extends ValueBase>
Store during open.
SdbRecordKey<K extends KeyBase, V extends ValueBase>
Record snapshot.
SdbRecordRef<K extends KeyBase, V extends ValueBase>
Record reference.
SdbRecordSnapshot<K extends KeyBase, V extends ValueBase>
Record snapshot.
SdbSingleStoreTransaction<K extends KeyBase, V extends ValueBase>
Single store transaction.
SdbStoreRef<K extends KeyBase, V extends ValueBase>
A simple db store definition.
SdbTransaction
SimpleDb transaction.
SdbTransactionStoreRef<K extends KeyBase, V extends ValueBase>
Transaction store reference.
SdbUpperBoundary<T extends Object>
Upper boundary. (excluded by default).
SdbVersionChangeEvent
Event passed to SdbOnVersionChangeCallback.

Enums

SdbTransactionMode
Transaction mode.

Extensions

SdbDatabaseExtension on SdbDatabase
SimpleDb methods.
SdbFactoryExtension on SdbFactory
Sdb Factory extension.
SdbIndex1RefExtension on SdbIndex1Ref<K, V, I>
Extension on index on 1 field.
SdbIndex2RefExtension on SdbIndex2Ref<K, V, I1, I2>
Extension on index on 2 fields.
SdbIndex3RefExtension on SdbIndex3Ref<K, V, I1, I2, I3>
Extension on index on 3 fields.
SdbIndex4RefExtension on SdbIndex4Ref<K, V, I1, I2, I3, I4>
Extension on index on 4 fields.
SdbIndexRecordKeyListExt on List<SdbIndexRecordKey<K, V, I>>
Common extension
SdbIndexRecordRefExtension on SdbIndexRecordRef<K, V, I>
Index record reference extension.
SdbIndexRecordSnapshotListExt on List<SdbIndexRecordSnapshot<K, V, I>>
Common extension
SdbIndexRefExtension on SdbIndexRef<K, V, I>
Index methods.
SdbMultiStoreTransactionExtension on SdbMultiStoreTransaction
Transaction store actions.
SdbOpenDatabaseExtension on SdbOpenDatabase
Database action during open.
SdbOpenStoreRefExtension on SdbOpenStoreRef<K, V>
Store action during open.
SdbRecordKeyListExt on List<SdbRecordKey<K, V>>
Common extension
SdbRecordRefExtension on SdbRecordRef<K, V>
Store methods.
SdbRecordSnapshotListExt on List<SdbRecordSnapshot<K, V>>
Common extension
SdbSingleStoreTransactionExtension on SdbSingleStoreTransaction<K, V>
Single store transaction extension.
SdbStoreRefExtension on SdbStoreRef<K, V>
Store methods.
SdbTransactionStoreRefExtension on SdbTransactionStoreRef<K, V>
Transaction store actions.

Constants

kSdbDartIsWeb → const bool
Web constant helper (needed for non-flutter app)

Properties

sdbFactoryIo SdbFactory
Sembast io factory.
final
sdbFactoryMemory SdbFactory
Memory factory.
final
sdbFactoryWeb SdbFactory
Native (browser) factory.
final

Functions

sdbFactoryFromIdb(IdbFactory idbFactory) SdbFactory
Factory from idb factory.

Typedefs

SdbModel = Map<String, Object?>
Model class.
SdbOnVersionChangeCallback = FutureOr<void> Function(SdbVersionChangeEvent event)
Callback for SdbOpenDatabase.onVersionChange.