@qualithm/rqlite-client - v0.3.10
    Preparing search index...

    Type Alias RqliteConfig

    Configuration for the rqlite client.

    type RqliteConfig = {
        auth?: RqliteAuth;
        authProvider?: RqliteAuthProvider;
        clusterDiscovery?: boolean;
        consistencyLevel?: ConsistencyLevel;
        fetch?: FetchFunction;
        followRedirects?: boolean;
        freshness?: FreshnessOptions;
        host: string;
        hosts?: string[];
        maxRedirects?: number;
        maxRetries?: number;
        retryBaseDelay?: number;
        timeout?: number;
        tls?: boolean;
    }
    Index

    Properties

    auth?: RqliteAuth

    Basic authentication credentials.

    authProvider?: RqliteAuthProvider

    Callback resolving basic authentication credentials, for rotating secrets.

    Takes precedence over auth when both are set.

    clusterDiscovery?: boolean

    Enable cluster discovery via the /nodes endpoint.

    When true (default), after a successful request the client refreshes its peer list by calling /nodes in the background. On subsequent network failures the client rotates through all known peers rather than retrying a single host.

    Set to false when a load balancer or Kubernetes service handles node selection, so the client communicates only with the configured host.

    consistencyLevel?: ConsistencyLevel

    Default consistency level for queries.

    Custom fetch implementation to use for HTTP requests.

    Supply a pre-configured fetch function to enable mTLS or other advanced transport options. When omitted, the global fetch is used.

    // Node.js with undici
    import { Agent, fetch as undiciFetch } from "undici"
    const agent = new Agent({ connect: { ca, cert, key } })
    const client = createRqliteClient({
    host: "localhost:4001",
    tls: true,
    fetch: (input, init) => undiciFetch(input, { ...init, dispatcher: agent }),
    })
    followRedirects?: boolean

    Automatically follow leader redirects (HTTP 301/307). Defaults to true.

    freshness?: FreshnessOptions

    Default freshness options for stale reads.

    host: string

    Host and port of the primary rqlite node (e.g. "localhost:4001").

    hosts?: string[]

    Additional seed hosts to use for cluster bootstrapping (e.g. ["localhost:4003", "localhost:4005"]).

    Combined with host to form the initial peer pool. Used when the primary host is unreachable — the client will try each seed in order before giving up. Ignored when clusterDiscovery is false.

    maxRedirects?: number

    Maximum number of leader redirect attempts. Defaults to 5.

    maxRetries?: number

    Maximum number of retry attempts for transient failures. Defaults to 3.

    retryBaseDelay?: number

    Base delay in milliseconds for exponential backoff between retries. Defaults to 100.

    timeout?: number

    Default request timeout in milliseconds.

    tls?: boolean

    Use HTTPS instead of HTTP.