TinyBase logoTinyBase β

DpcTabularValues

The DpcTabularValues type describes the configuration for handling Values in a database-oriented Persister that is operating in tabular mode.

{
  load?: boolean;
  save?: boolean;
  tableName?: string;
}
TypeDescription
load?boolean

Whether Store Values will be loaded from a database table.

save?boolean

Whether Store Values will be saved to a database table.

tableName?string

The optional name of the database table from and to which the Store Values should be loaded or saved, defaulting to tinybase_values.

Note that both loading and saving of Values from and to the database are disabled by default.

The 'Dpc' prefix indicates that this type is used within the DatabasePersisterConfig type.

Example

When applied to a database Persister, this DatabasePersisterConfig will load and save the data of a Store's Values into a database table called 'my_tinybase_values'.

import type {DatabasePersisterConfig} from 'tinybase';

export const databasePersisterConfig: DatabasePersisterConfig = {
  mode: 'tabular',
  values: {
    load: true,
    save: true,
    tableName: 'my_tinybase_values',
  },
};

Since

v4.0.0