Member Junction
    Preparing search index...

    Lightweight adapter for testing SQL Server connectivity via raw TCP sockets.

    Does not perform SQL authentication or execute queries — only verifies that the host:port is accepting TCP connections. This is sufficient for preflight checks and post-provisioning validation.

    const adapter = new SqlServerAdapter();
    const result = await adapter.CheckConnectivity('db.example.com', 1433, 10000);
    console.log(result.Reachable ? 'OK' : result.ErrorMessage);
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Test TCP connectivity to a SQL Server instance.

      Opens a raw TCP socket to the specified host and port. If the connection is established within the timeout, returns { Reachable: true }. Otherwise returns a structured error with a human-readable message tailored to common failure modes (ECONNREFUSED, ENOTFOUND, ETIMEDOUT, ECONNRESET).

      Parameters

      • host: string

        SQL Server hostname or IP address.

      • port: number

        SQL Server TCP port (typically 1433).

      • timeoutMs: number = 5000

        Maximum time to wait for the connection, in milliseconds (default: 5000).

      Returns Promise<SqlConnectivityResult>

      Connectivity result with reachability status, optional error, and latency.

      const result = await adapter.CheckConnectivity('localhost', 1433);
      if (!result.Reachable) {
      console.error(`SQL Server unreachable: ${result.ErrorMessage}`);
      }