StandardVersionsRepo

Standard implementation of VersionsRepo that delegates version storage to a StandardVersionsRepoProxy. On setTableVersion: calls StandardVersionsRepoProxy.database.onCreate if the table has no version yet, then iterates onUpdate for each version step until the target version is reached.

Parameters

proxy

The StandardVersionsRepoProxy used to read and write version numbers

Type Parameters

T

The type of the underlying database or storage object

Constructors

Link copied to clipboard
constructor(proxy: StandardVersionsRepoProxy<T>)

Functions

Link copied to clipboard
open suspend override fun setTableVersion(tableName: String, version: Int, onCreate: suspend T.() -> Unit = {}, onUpdate: suspend T.(from: Int, to: Int) -> Unit = { _, _ ->})

By default, instance of this interface will check that version of table with name tableName is less than version or is absent