Cloud API Overview > @adpt/cloud > postgres > Postgres
postgres.Postgres() function
An abstract component representing a Postgres database within a Postgres server or service.
Signature:
export declare function Postgres(): null;
Returns:
null
Remarks
Implements the ConnectToInstance interface.
Instance methods:
connectEnv(scope?: NetworkScope): Environment | undefined
Returns the set of environment variables that have all the information needed for a Postgres client to connect to this database. The returned environment variables are named such that some common Postgres clients can use them directly:
PGHOST
: The host to connect to.
PGDATABASE
: The name of the database.
PGUSER
: Username to use to authenticate to the database server or service.
PGPASSWORD
: Password to use to authenticate to the database server or service.
Note that because this component is an abstract component, connectEnv
always returns undefined
. This abstract component should be replaced (using a style sheet) with a non-abstract component, such as postgres.TestPostgres() that will provide its own implementation of connectEnv
.