Cloud API Overview > @adpt/cloud > postgres > PostgresProvider
postgres.PostgresProvider() function
Component that represents an external provider of a Postgres database
Signature:
export declare function PostgresProvider(props: PostgresProviderProps): null;
Parameters
Parameter | Type | Description |
---|---|---|
props | PostgresProviderProps |
Returns:
null
Remarks
See postgres.PostgresProviderProps.
Use this component to connect other cloud components to a external Postgres services, such as Google CloudSQL or Amazon RDS.
Example
const pg = handle();
<PostgresProvider handle={pg}
hostname="mypostgres.com:5432"
db="db"
user="myuser"
password={process.env.PGPASSWORD}
/>
<NodeService src="/somedir" connectTo={pg} />