Interface for a key-value database.

interface IKeyValueDatabase {
    close(): void;
    getName(): string;
    getOwnerId(): string;
    getTable<T>(tableName: string): IDatabaseTable<T>;
    subscribe(callback: ((event: IDatabaseEvent) => void)): void;
    unsubscribe(): void;
}

Hierarchy (view full)

Methods

  • Close the database.

    Returns void

  • Get the name of the database.

    Returns string

  • Gets the table with the given name.

    Type Parameters

    Parameters

    • tableName: string

      The name of the table to get.

    Returns IDatabaseTable<T>

    The table.

  • Subscribe to datase events.

    Parameters

    • callback: ((event: IDatabaseEvent) => void)

      The callback to call when a database event is published.

    Returns void

  • Unsubscribe from database events.

    Returns void