IF Commons GitHub

sql/cli/resolve

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0046-arcactl FR-014

Where arcactl connects when it is given no URL (commons data 0046-arcactl FR-014): as psql does, from libpq's variables, then from the service the variable PGSERVICE names in pg_service.conf, and the password from PGPASSWORD, then from the service, then from .pgpass. Bun's own client reads the variables and neither file, so without this the connection that arcactl init sets up (a service and a line of .pgpass) is one that psql uses and arcactl doctor cannot. A target is made only where a host is known; otherwise the driver reads the environment and the sockets as it did. No password is ever printed.

Source: commons/data/sql/cli/resolve.ts

2 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

resolveTargetfunction
function resolveTarget(env: Readonly<Record<string, string | undefined>>, platform?: Platform | undefined, home?: string | undefined): Target | undefined

The target libpq's variables and files give, or nothing where no host is known.

ParameterWhat it is
envthe environment
platformwhose files these are; this machine's by default
homethe home directory; this user's by default

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

urlOfTargetfunction
function urlOfTarget(t: Target): string

The URL of a target, for the program and never for the screen: the user and the password are encoded.

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.