sql-switch - v1.0.1
    Preparing search index...

    Class DatabaseUnavailableError

    Thrown when the write collector circuit breaker trips — either the pending buffer hit the 5000-key cap or the database became unreachable. The app should catch this and enter a graceful read-only mode.

    try {
    await db.schema("economy").table("balances").key(userId).set({ coins: 100 });
    } catch (err) {
    if (err instanceof DatabaseUnavailableError) enterReadOnlyMode();
    }

    Hierarchy

    • Error
      • DatabaseUnavailableError
    Index
    code: "DATABASE_UNAVAILABLE" = ...