# KeyValueBasedVersionsRepoProxy

class KeyValueBasedVersionsRepoProxy < T >(keyValueStore: KeyValueRepo < String , Int >, val database: T ) : StandardVersionsRepoProxy < T > (source)

StandardVersionsRepoProxy implementation backed by a KeyValueRepo mapping table names to version numbers. Stores and retrieves per-table version integers using keyValueStore with table names as keys.

#### Parameters

keyValueStore

KeyValueRepo used to persist table-name-to-version mappings

database

The underlying database or storage object exposed via StandardVersionsRepoProxy.database

#### Type Parameters

T

The type of the underlying database or storage object

## Constructors

KeyValueBasedVersionsRepoProxy
Link copied to clipboard
constructor(keyValueStore: KeyValueRepo < String , Int >, database: T )

## Properties

database
Link copied to clipboard
open override val database : T

## Functions

getTableVersion
Link copied to clipboard
open suspend override fun getTableVersion (tableName: String ): Int ?

Returns the current version number for the given tableName, or null if no version is stored.

updateTableVersion
Link copied to clipboard
open suspend override fun updateTableVersion (tableName: String , version: Int )

Persists the given version number for the given tableName.