WebStorage

class WebStorage(val dbName: String = "MultipazStorage", clock: Clock = Clock.System) : BaseStorage

Storage implementation based on IndexedDB for both Kotlin/JS and Kotlin/Wasm.

Constructors

Link copied to clipboard
constructor(dbName: String = "MultipazStorage", clock: Clock = Clock.System)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
protected open suspend override fun createTable(tableSpec: StorageTableSpec): BaseStorageTable

Creates a table that implements tableSpec.

Link copied to clipboard
protected suspend fun enumerateTables(): List<BaseStorageTable>

API for the derived classes to be able to iterate through all the tables in the storage. This includes a (hidden) schema table defined in SchemaTableSpec.

Link copied to clipboard
open suspend override fun getTable(spec: StorageTableSpec): StorageTable

Get the table with specific name and features.

Link copied to clipboard
protected fun initTables(tables: List<BaseStorageTable>)

API for the derived classes to be able to initialize newly created BaseStorage with the given list of tables. This must includes a (hidden) schema table defined in SchemaTableSpec.

Link copied to clipboard
open suspend override fun purgeExpired()

Reclaim the storage occupied by expired entries across all tables in this Storage object (even if these tables were never accessed using getTable in this session).