# addDatabase

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

Adds an Azure PostgreSQL database to the application model.

## Definition

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

## Parameters

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

## Returns

[AzurePostgresFlexibleServerDatabaseResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurepostgresflexibleserverdatabaseresource.md) `builder`

## Applies to

- [AzurePostgresFlexibleServerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource.md)
