Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Database

Database class is basically a DatabaseObject with save and load functionality

see

SyncDatabase - A database that works sync instead of using promises

see

Database.constructor() - the constructor

see

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

see

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

see

Database.data - the data of the array

see

Database.length - the array length

see

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

see

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

see

Database.setDefaults() - sets defaults for the Database

see

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

see

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

see

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

see

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

see

Database.generateId() - checks if the Database - 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(): Promise<this>
  • 🔄 Reload the data from the database

    author

    Nicolas Schmidt <@nsc-de>

    see

    Database - 👩‍👦 the parent class

    Returns Promise<this>

    ⌛ Promise (Ready when loaded) >> the database itself, so you can chain operations

saveData

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

    author

    Nicolas Schmidt <@nsc-de>

    see

    Database - 👩‍👦 the parent class

    Returns Promise<this>

    ⌛ Promise (Ready when saved) >> 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