# ZitadelResource.withExistingDatabase

- Module: [CommunityToolkit.Aspire.Hosting.Zitadel](/reference/api/typescript/communitytoolkit.aspire.hosting.zitadel.md)
- Defined on: [ZitadelResource](/reference/api/typescript/communitytoolkit.aspire.hosting.zitadel/zitadelresource.md)
- Version: `13.4.0`
- Kind: `method`

Adds database support to the Zitadel resource.

## Definition

```typescript
interface ZitadelResource {
  // ... omitted for brevity
  withExistingDatabase(database: PostgresDatabaseResource): ZitadelResource;
}
```

## Signature

```typescript
withExistingDatabase(database: PostgresDatabaseResource): ZitadelResource
```

## Parameters

- `database` (`PostgresDatabaseResource`)

## Returns

[ZitadelResource](/reference/api/typescript/communitytoolkit.aspire.hosting.zitadel/zitadelresource.md) `builder`

## Defined on

- [ZitadelResource](/reference/api/typescript/communitytoolkit.aspire.hosting.zitadel/zitadelresource.md) -- `handle`
