# addDatabase

- Module: [Aspire.Hosting.PostgreSQL](/reference/api/typescript/aspire.hosting.postgresql.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Adds a PostgreSQL database to the application model.

## Definition

```typescript
interface PostgresServerResource {
  // ... omitted for brevity
  addDatabase(
    name: string,
    databaseName?: string): PostgresDatabaseResource
}
```

## Parameters

- `name` (`string`)
- `databaseName` (`string`) `optional`

## Returns

[PostgresDatabaseResource](/reference/api/typescript/aspire.hosting.postgresql/postgresdatabaseresource.md) `builder`

## Applies to

- [PostgresServerResource](/reference/api/typescript/aspire.hosting.postgresql/postgresserverresource.md)
