Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Database

Manages data stored by the service on the jarbunq.db file.

Hierarchy

  • any
    • Database

Index

Properties

Accessors

Methods

Properties

db

db: any

Holds the lowdb instance.

get

get: Function

Shortcut to db.get().

has

has: Function

Shortcut to db.has().

set

set: Function

Shortcut to db.set().

unset

unset: Function

Shortcut to db.unset().

Accessors

Static Export assignment Instance

Methods

cleanup

  • cleanup(): Promise<void>
  • Cleanup the database by removing old or invalid records.

    Returns Promise<void>

dump

  • dump(safe: boolean): any
  • Gets the full database as a JSON.

    Parameters

    • safe: boolean

      Set to true to exlude tokens and credentials, default is false.

    Returns any

init

  • init(): Promise<void>

insert

  • insert(table: string, value: any): void
  • Shortcut to add a new object to the specified table.

    Parameters

    • table: string

      The table name.

    • value: any

      The object to be added.

    Returns void

migrations

  • migrations(): Promise<void>
  • Execute migrations from the /migrations folder.

    Returns Promise<void>

Generated using TypeDoc