IF Commons GitHub

sql/cli/state

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0047-arcactl-init FR-011

What arcactl remembers of a person's instances (commons data 0047-arcactl-init FR-011): a JSON file in its own settings folder that it owns whole, with the instances it knows, which is the default, and the profiles it has put the shell script into. It holds no password and no key: a password is in .pgpass, which libpq reads, and nowhere else.

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

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

Installedinterfaceno test imports it
interface Installed

A shell profile the script is in.

MemberTypeWhat it is
shellShell
filesreadonly string[]The files whose block was written.
cachestringThe cached script they source.
Knowninterfaceno test imports it
interface Known

An instance arcactl knows.

MemberTypeWhat it is
namestring
env?stringWhat it is for: dev, staging, prod.
schema?string
models?readonly string[]
host?string
port?number
database?string
user?string
sslmode?string
ownsService?booleanWhether arcactl wrote its service to pg_service.conf (and so owns it), as opposed to the person's own.
planStateconstno test imports it
const planState: (paths: Paths, s: State) => Result<Change, FileError>

Plans writing the state.

stateTextconst
const stateText: (s: State) => string

The text of a state file: stable, so that writing the same state again changes nothing.

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

withInstancefunctionno test imports it
function withInstance(s: State, k: Known, makeDefault: boolean): State

The state with an instance put in: replaced where its name is there.

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