prorm API Reference
    Preparing search index...

    Class ReplicaManager

    ReplicaManager class for managing read replicas with lag detection

    Hierarchy

    • EventEmitter
      • ReplicaManager
    Index
    • Remove a replica from the manager

      Parameters

      • name: string

      Returns Promise<void>

    • Get a replica by name

      Parameters

      • name: string

      Returns ReplicaPool | undefined

    • Check replication lag for a specific replica Uses dialect-specific queries for lag detection

      Parameters

      • name: string

      Returns Promise<number | null>

    • Select a replica based on the current routing strategy

      Returns Promise<{ name: string; pool: ReplicaPool }>

    • Execute a query on a replica (auto-selects replica based on routing strategy)

      Parameters

      Returns Promise<any>

    • Check if replication is enabled

      Returns boolean