prorm API Reference
    Preparing search index...

    Class EventStoreStore

    EventStoreStore wraps an @eventstore/db-client EventStoreDBClient and exposes appending events, catch-up subscriptions, and stream reads.

    Implements

    Index
    name: "eventstore" = 'eventstore'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "@eventstore/db-client" = '@eventstore/db-client'

    The client library being used

    • Append one event carrying message to stream via appendToStream. The message is turned into a JSON event (jsonEvent) with options.type (default 'message'). Returns the driver's append result (next expected revision, etc.).

      Parameters

      • stream: string
      • message: EventStoreMessage
      • options: AppendOptions = {}

      Returns Promise<any>

    • Streams are created implicitly by the first append in EventStoreDB, so this is a documented no-op that resolves without contacting the server. Provided to satisfy the common store surface (alias createTopic).

      Parameters

      • _name: string

      Returns Promise<void>

    • Alias for createStream(), matching the common store surface.

      Parameters

      • name: string

      Returns Promise<void>

    • Read events from stream into an array by draining the driver's async iterable. Options (fromRevision, maxCount, direction, ...) are passed straight through.

      Parameters

      • stream: string
      • Optionaloptions: unknown

      Returns Promise<any[]>

    • Subscribe to stream with a catch-up subscription (subscribeToStream), invoking handler once per resolved event. Returns a subscription whose stop() ends it; it is tracked so disconnect() ends it too. The consuming loop runs detached (not awaited); this method resolves once the subscription is opened.

      Parameters

      • stream: string
      • handler: (event: any) => void | Promise<void>
      • options: EventStoreSubscribeOptions = {}

      Returns Promise<EventStoreSubscription>