# Aspire.Hosting.PostgreSQL

- Module: `Aspire.Hosting.PostgreSQL`
- Version: `13.4.0`
- Source: [GitHub](https://github.com/microsoft/aspire)
- Functions: `14`
- Types: `5`

## Types

- [PgAdminContainerResource](/reference/api/typescript/aspire.hosting.postgresql/pgadmincontainerresource.md) -- `handle` - 1 members
- [PgWebContainerResource](/reference/api/typescript/aspire.hosting.postgresql/pgwebcontainerresource.md) -- `handle` - 1 members
- [PostgresDatabaseResource](/reference/api/typescript/aspire.hosting.postgresql/postgresdatabaseresource.md) -- `handle` - 7 members -- A resource that represents a PostgreSQL database. This is a child resource of a {@ats-ref type:PostgresServerResource}.
- [PostgresMcpContainerResource](/reference/api/typescript/aspire.hosting.postgresql/postgresmcpcontainerresource.md) -- `handle` - 0 members
- [PostgresServerResource](/reference/api/typescript/aspire.hosting.postgresql/postgresserverresource.md) -- `handle` - 21 members -- A resource that represents a PostgreSQL container.

## Functions

- [addDatabase](/reference/api/typescript/aspire.hosting.postgresql/adddatabase.md) -- `method` -- Adds a PostgreSQL database to the application model.
- [addPostgres](/reference/api/typescript/aspire.hosting.postgresql/addpostgres.md) -- `method` -- Adds a PostgreSQL resource to the application model. A container is used for local development.
- [withCreationScript](/reference/api/typescript/aspire.hosting.postgresql/withcreationscript.md) -- `method` -- Defines the SQL script used to create the database.
- [withDataBindMount](/reference/api/typescript/aspire.hosting.postgresql/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a PostgreSQL container resource.
- [withDataVolume](/reference/api/typescript/aspire.hosting.postgresql/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a PostgreSQL container resource.
- [withHostPort](/reference/api/typescript/aspire.hosting.postgresql/withhostport.md) -- `method` -- Configures the host port that the PGAdmin resource is exposed on instead of using randomly assigned port.
- [withHostPort](/reference/api/typescript/aspire.hosting.postgresql/withhostport.md) -- `method` -- Configures the host port that the pgweb resource is exposed on instead of using randomly assigned port.
- [withHostPort](/reference/api/typescript/aspire.hosting.postgresql/withhostport.md) -- `method` -- Configures the host port that the PostgreSQL resource is exposed on instead of using randomly assigned port.
- [withInitFiles](/reference/api/typescript/aspire.hosting.postgresql/withinitfiles.md) -- `method` -- Copies init files to a PostgreSQL container resource.
- [withPassword](/reference/api/typescript/aspire.hosting.postgresql/withpassword.md) -- `method` -- Configures the password that the PostgreSQL resource is used.
- [withPgAdmin](/reference/api/typescript/aspire.hosting.postgresql/withpgadmin.md) -- `method` -- Adds a pgAdmin 4 administration and development platform for PostgreSQL to the application model.
- [withPgWeb](/reference/api/typescript/aspire.hosting.postgresql/withpgweb.md) -- `method` -- Adds an administration and development platform for PostgreSQL to the application model using pgweb.
- [withPostgresMcp](/reference/api/typescript/aspire.hosting.postgresql/withpostgresmcp.md) -- `method` -- Adds a Postgres MCP server container and configures it to connect to the database represented by `builder`.
- [withUserName](/reference/api/typescript/aspire.hosting.postgresql/withusername.md) -- `method` -- Configures the user name that the PostgreSQL resource is used.
