Class ClientBase

Defines the base functionality for clients.

Hierarchy (view full)

Constructors

Properties

_clientNative: Client | PoolClient
_drain?: Subject<void>
_end?: Subject<void>
_error?: Subject<Error>
_notice?: Subject<NoticeMessage>
_notification?: Subject<Notification>

Accessors

  • get onDrain(): Subject<void>
  • A Subject that emits drain events.

    Returns Subject<void>

  • get onEnd(): Subject<void>
  • A Subject that emits end events.

    Returns Subject<void>

  • get onError(): Subject<Error>
  • A Subject that emits error events.

    Returns Subject<Error>

  • get onNotice(): Subject<NoticeMessage>
  • A Subject that emits notice events.

    Returns Subject<NoticeMessage>

  • get onNotification(): Subject<Notification>
  • A Subject that emits notification events.

    Returns Subject<Notification>

Methods

  • Queries a database, returning query results after all results have been returned.

    Type Parameters

    • T extends QueryResultRow = any
    • I = any[]

    Parameters

    • config: QueryConfig<I> & {
          returnsCursors?: false;
          stream?: false;
      }

      Defines query parameters

    Returns Observable<QueryResult<T>>

  • Queries a database, streaming query results as they are read.

    Type Parameters

    • T = any
    • I = any[]

    Parameters

    Returns Observable<T>

  • Queries a database, returning query results by cursor after cursor has read all rows.

    Type Parameters

    • I = any[]

    Parameters

    • config: QueryConfig<I> & {
          returnsCursors: true;
          stream?: false;
      }

      Defines query parameters

    Returns Observable<QueryCursorResult>

  • Queries a database, streaming query results as cursor reads rows.

    Type Parameters

    • I = any[]

    Parameters

    Returns Observable<QueryCursorRow>

  • Completes after one drain event has been observed.

    Parameters

    • eventName: "drain"

    Returns Observable<void>

  • Completes after one end event has been observed.

    Parameters

    • eventName: "end"

    Returns Observable<void>

  • Completes after one error has been observed.

    Parameters

    • eventName: "error"

    Returns Observable<Error>

  • Completes after one NoticeMessage has been observed.

    Parameters

    • eventName: "notice"

    Returns Observable<NoticeMessage>

  • Completes after one Notification has been observed.

    Parameters

    • eventName: "notification"

    Returns Observable<Notification>

  • Unsubscribes from an event subject or all event subjects.

    Parameters

    • Optional eventName: "error" | "end" | "drain" | "notice" | "notification"

      A Client event name

    Returns this