Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClientDatabaseManager

Hierarchy

Index

Constructors

Properties

cache: Dict<number, ClientDatabase>
client: PteroClient
meta: PaginationMeta = ...
serverId: string

Accessors

  • get FILTERS(): readonly never[]
  • get INCLUDES(): readonly string[]
  • get SORTS(): readonly never[]

Methods

  • _patch(data: any): any
  • Transforms the raw database object(s) into typed objects.

    Parameters

    • data: any

      The resolvable database object(s).

    Returns any

    The resolved database object(s).

  • delete(id: number): Promise<void>
  • Deletes a database from the server.

    example
    const server = await client.servers.fetch('1c639a86');
    await server.databases.delete(2).catch(console.error);

    Parameters

    • id: number

      The ID of the database.

    Returns Promise<void>

  • getFetchAll<T, K>(...options: unknown[]): Promise<Dict<T, K>>
  • getQueryOptions(): { filters: readonly string[]; includes: readonly string[]; sorts: readonly string[] }
  • Gets the allowed query options from the inherited manager.

    internal

    Returns { filters: readonly string[]; includes: readonly string[]; sorts: readonly string[] }

    The query options.

    • filters: readonly string[]
    • includes: readonly string[]
    • sorts: readonly string[]
  • Rotates the password of a specified database.

    example
    const server = await client.servers.fetch('1c639a86');
    await server.databases.rotate(1)
    .then(console.log)
    .catch(console.error);

    Parameters

    • id: number

      The ID of the database.

    Returns Promise<ClientDatabase>

    The updated database.

Generated using TypeDoc