Cloud API Overview > @adpt/cloud > postgres > TestPostgres
postgres.TestPostgres() function
A component suitable for creating test scenarios that creates a simple, temporary Postgres database that loads test data from a .sql file and which implements the abstract postgres.Postgres() interface.
Signature:
export declare function TestPostgres(props: SFCDeclProps<TestPostgresProps>): Adapt.AdaptElement<Adapt.AnyProps>;
Parameters
Parameter | Type | Description |
---|---|---|
props | SFCDeclProps<TestPostgresProps> |
Returns:
Adapt.AdaptElement<Adapt.AnyProps>
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.