Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SyncDatabase

SyncDatabase class is basically a DatabaseObject with save and load functionality. It is written synchronously (without using promises)

see

Database - A database that works using promises for better performance

see

SyncDatabase.constructor() - the constructor

see

SyncDatabase.saveData() - saves the data to the DatabaseAdapter

see

SyncDatabase.reloadData() - loads the data from the DatabaseAdapter

see

SyncDatabase.data - the data of the array

see

SyncDatabase.length - the array length

see

SyncDatabase.set() - sets a value from the SyncDatabase

see

SyncDatabase.setDefault() - sets a default value from the SyncDatabase

see

SyncDatabase.setDefaults() - sets defaults for the SyncDatabase

see

SyncDatabase.get() - gets a value from the SyncDatabase

see

SyncDatabase.getNormal() - gets a value from the SyncDatabase and normalizes it

see

SyncDatabase.update() - updates a value from the SyncDatabase

see

SyncDatabase.contains() - checks if the SyncDatabase contains a value

see

SyncDatabase.generateId() - checks if the SyncDatabase - Generates an id using a namespace

Hierarchy

Index

Constructors

constructor

Properties

adapter

the adapter to get the data from / save the data to

Accessors

data

length

  • get length(): number

Methods

contains

  • contains(key: string | Array<string | number>): boolean

generateId

  • generateId(name: string): number

get

getNormal

reloadData

  • reloadData(): this
  • 🔄 Reload the data from the database

    author

    Nicolas Schmidt <@nsc-de>

    see

    SyncDatabase - 👩‍👦 the parent class

    Returns this

    the database itself, so you can chain operations

saveData

  • saveData(): this
  • 💾 Save the data from the database

    author

    Nicolas Schmidt <@nsc-de>

    see

    SyncDatabase - 👩‍👦 the parent class

    Returns this

    the database itself, so you can chain operations

set

  • Sets a value from the DatabaseObject.

    author

    Nicolas Schmidt <@nsc-de>

    see

    DatabaseObject - 👩‍👦 the parent class

    Parameters

    • key: string | Array<string | number>

      the path to apply the value to

    • value: DatabaseInsertable

      the value to apply to the given path

    Returns this

    the DatabaseObject itself, so you can chain operations like that

setDefault

setDefaults

update

Generated using TypeDoc