Base storage driver class, implementing IStorageDriver and handling the lifecycle for you

Hierarchy (View Summary)

Constructors

Properties

_dbName: string
_log: Logger
_platform: ICorePlatform
db: IDBDatabase

Accessors

  • get loaded(): boolean
  • Returns boolean

Methods

  • Returns Promise<void>

  • Returns Promise<void>

  • Returns number

  • Cleanup session and release all used resources.

    May be called more than once, handle this with care (or use BaseStorageDriver that handles this for you)

    Returns Promise<void>

  • Load session from some external storage. Should be used either to load data from file/network/etc to memory, or to open required connections to fetch data on demand

    May be called more than once, handle this with care (or use BaseStorageDriver that handles this for you)

    Returns Promise<void>

  • Parameters

    • repo: string
    • version: number
    • migration: MigrationFunction

    Returns void

  • Save session to some external storage. Should be used to commit pending changes in the session. For example, saving session content to file/network/etc, or committing a database transaction

    It is safe to batch all changes and only commit them here, unless stated otherwise in the method description

    Returns MaybePromise<void>

  • Parameters

    • repoCount: number

    Returns void

  • Parameters

    • os: string
    • obj: unknown

    Returns void