Interface CrudInterface

This CRUD interface is used by the manager to abstract storage.

Hierarchy

Methods

  • Empties a table completely.

    Type Parameters

    Parameters

    • table: T

      Where to delete everything.

    Returns Promise<boolean>

  • Delete data in a table, based on a filter.

    Type Parameters

    Parameters

    • table: T

      Where to delete in.

    • filter: Partial<DataTypes[T]>

      An object to filter data.

    Returns Promise<boolean>

  • Inserts a value in the database and returns its id.

    Type Parameters

    Parameters

    Returns Promise<number>

  • Inserts multiple values in the database.

    Type Parameters

    Parameters

    Returns Promise<boolean>

  • Gets all data from a table in the database.

    Type Parameters

    Parameters

    • table: T

      Where to get from.

    Returns Promise<null | DataTypes[T][]>

  • Gets specific data from a table in the database.

    Type Parameters

    Parameters

    • table: T

      Where to get from.

    • id: Id

      What to get.

    Returns Promise<null | DataTypes[T]>

  • Gets data from a table in the database with a filter.

    Type Parameters

    Parameters

    • table: T

      Where to get from.

    • filter: Partial<DataTypes[T]>

      An object to filter data.

    Returns Promise<null | DataTypes[T][]>

  • Updates data in a table.

    Type Parameters

    Parameters

    • table: T

      Where to update.

    • id: Id

      What to update.

    • value: DataTypes[T]

      How to update.

    Returns Promise<boolean>

  • Updates data in a table.

    Type Parameters

    Parameters

    • table: T

      Where to update.

    • filter: Partial<DataTypes[T]>

      An object to filter data.

    • value: Partial<DataTypes[T]>

      How to update.

    Returns Promise<boolean>

Generated using TypeDoc