# AzurePostgresFlexibleServerResource.addDatabase

- Module: [Aspire.Hosting.Azure.PostgreSQL](/reference/api/typescript/aspire.hosting.azure.postgresql.md)
- Defined on: [AzurePostgresFlexibleServerResource](/reference/api/typescript/aspire.hosting.azure.postgresql/azurepostgresflexibleserverresource.md)
- Version: `13.4.0`
- Kind: `method`

Adds an Azure PostgreSQL database to the application model.

## Definition

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

## Signature

```typescript
addDatabase(
    name: string,
    databaseName?: string): AzurePostgresFlexibleServerDatabaseResource
```

## Parameters

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

## Returns

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

## Defined on

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