Skip to content
DocsTry Aspire
DocsTry

Aspire.Hosting.PostgreSQL

Official
📦 Aspire.Hosting.PostgreSQLv13.4.0
14Functions
5Types

Types

Functions

methodaddDatabasebuilder
Adds a PostgreSQL database to the application model.
addDatabase(name: string, databaseName?: string): PostgresDatabaseResource
methodaddPostgresbuilder
Adds a PostgreSQL resource to the application model. A container is used for local development.
addPostgres(name: string, userName?: ParameterResource, password?: ParameterResource, port?: number): PostgresServerResource
methodwithCreationScriptbuilder
Defines the SQL script used to create the database.
withCreationScript(script: string): PostgresDatabaseResource
methodwithDataBindMountbuilder
Adds a bind mount for the data folder to a PostgreSQL container resource.
withDataBindMount(source: string, isReadOnly?: boolean): PostgresServerResource
methodwithDataVolumebuilder
Adds a named volume for the data folder to a PostgreSQL container resource.
withDataVolume(name?: string, isReadOnly?: boolean): PostgresServerResource
methodwithHostPortbuilder
Configures the host port that the PGAdmin resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): PgAdminContainerResource
methodwithHostPortbuilder
Configures the host port that the pgweb resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): PgWebContainerResource
methodwithHostPortbuilder
Configures the host port that the PostgreSQL resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): PostgresServerResource
methodwithInitFilesbuilder
Copies init files to a PostgreSQL container resource.
withInitFiles(source: string): PostgresServerResource
methodwithPasswordbuilder
Configures the password that the PostgreSQL resource is used.
withPassword(password: ParameterResource): PostgresServerResource
methodwithPgAdminbuilder
Adds a pgAdmin 4 administration and development platform for PostgreSQL to the application model.
withPgAdmin(configureContainer?: (obj: PgAdminContainerResource) => Promise<void>, containerName?: string): PostgresServerResource
methodwithPgWebbuilder
Adds an administration and development platform for PostgreSQL to the application model using pgweb.
withPgWeb(configureContainer?: (obj: PgWebContainerResource) => Promise<void>, containerName?: string): PostgresServerResource
methodwithPostgresMcpbuilder
Adds a Postgres MCP server container and configures it to connect to the database represented by `builder`.
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => Promise<void>, containerName?: string): PostgresDatabaseResource
methodwithUserNamebuilder
Configures the user name that the PostgreSQL resource is used.
withUserName(userName: ParameterResource): PostgresServerResource