Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PartitioningAdapter

An adapter for adapters. Converts a non reference mode adapter into a reference mode adapter which can perform destructuring and partitioning. Each collection will be stored in its own key/save and only dirty collections will be saved. If you turn on paging with default page size of 25megs and save a 75 meg collection it should use up roughly 3 save slots (key/value pairs sent to inner adapter). A dirty collection that spans three pages will save all three pages again Paging mode was added mainly because Chrome has issues saving 'too large' of a string within a single IndexedDB row. If a single document update causes the collection to be flagged as dirty, all of that collection's pages will be written on next save.

Hierarchy

  • PartitioningAdapter

Implements

Index

Constructors

constructor

Properties

mode

mode: string

Methods

exportDatabase

  • exportDatabase(dbname: string, dbref: Loki): Promise<void>
  • Saves a database by partioning into separate key/value saves. (Loki 'reference mode' persistence adapter interface function)

    Parameters

    • dbname: string

      name of the database (filename/keyname)

    • dbref: Loki

      reference to database which we will partition and save.

    Returns Promise<void>

    a Promise that resolves after the database was deleted

loadDatabase

  • loadDatabase(dbname: string): Promise<any>

Static deregister

  • deregister(): void

Static register

  • register(): void

Generated using TypeDoc