Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0047-arcactl-init FR-011, 0047-arcactl-init FR-012
Finding the instances a person can reach (commons data 0047-arcactl-init FR-011, FR-012): from the connection the environment names, libpq's own variables, the services of pg_service.conf, the hosts .pgpass has passwords for, what arcactl already knows, and (where asked) PostgreSQL on this machine; and the arca.config.ts files in an Ergonex workspace. Then looking at each one and saying, without changing anything, whether it is reached, as whom, what that role could do to it (read, migrate, migrate and guard) and what arca it has. A password goes only to the host it is written for, never to a wildcard, and no password is printed.
Source: commons/data/sql/cli/discover.ts
6 of 8 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
interface Candidate
A place a person might connect to, and where we heard of it.
| Member | Type | What it is |
|---|
name | string | |
sources | readonly string[] | |
host? | string | |
port? | number | |
database? | string | |
user? | string | |
sslmode? | string | |
userService? | boolean | Where the person defined a service of this name themselves, outside arcactl's block. |
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
function discover(i: DiscoverInput): { readonly candidates: readonly Candidate[]; readonly configs: readonly string[]; }
The instances a person might reach, and the configurations their workspace has.
| Parameter | What it is |
|---|
i | what to look in |
Returns: the candidates, each with where it was heard of, and the arca.config.ts files
Imported by 13 tests of the run (13 passed, 0 failed): the library's results
function passwordFor(paths: Paths, c: Pick<Candidate, "database" | "host" | "port" | "user">): string | undefined
The password .pgpass has for a place, as libpq reads it (the first line that matches, each field exact or *); none where there is none.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
Probeinterfaceno test imports itinterface Probe
What looking at one instance found.
| Member | Type | What it is |
|---|
reachable | boolean | |
error? | string | |
version? | string | |
user? | string | |
superuser? | boolean | |
level | Level | |
arca | { readonly schema: string; readonly exists: boolean; readonly tables: number; readonly models: readonly ("arcaParty" | "arcaTenancy" | "contract" | "flow" | "identity" | "identityAbac" | "identityAccess" | "identityAgent" | "identityDelegation" | "identityDevice" | "identityMachine" | "identityPki" | "identityRebac" | "issues" | "meaning" | "operations" | "proof")[]; } | |
function probe(connect: (o: ConnectOptions) => Promise<Connection>, c: Candidate, password: string | undefined, schema?: string): Promise<Probe>
Looks at an instance: reads and changes nothing.
| Parameter | What it is |
|---|
connect | how a connection is made |
c | the instance |
password | the password .pgpass has for it, where there is one |
schema | the schema arca is looked for in |
Returns: what was found
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
tablesOfModelfunctionno test imports itfunction tablesOfModel(m: "arcaParty" | "arcaTenancy" | "contract" | "flow" | "identity" | "identityAbac" | "identityAccess" | "identityAgent" | "identityDelegation" | "identityDevice" | "identityMachine" | "identityPki" | "identityRebac" | "issues" | "meaning" | "operations" | "proof"): ReadonlySet<string>
The tables of a model with what it requires, as they are named in the database.
function urlOf(c: Candidate, password?: string | undefined): string
A connection URL for a candidate, with a password where there is one; the password is encoded, and the URL is for the program and never for the screen.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
function workspaceConfigs(root: string, depth?: number): readonly string[]
The arca.config.ts files under a workspace root, a few levels deep, leaving out what is not source.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results