# PostgresDatabaseResource.withCreationScript

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

Defines the SQL script used to create the database.

## Definition

```typescript
interface PostgresDatabaseResource {
  // ... omitted for brevity
  withCreationScript(script: string): PostgresDatabaseResource;
}
```

## Signature

```typescript
withCreationScript(script: string): PostgresDatabaseResource
```

## Parameters

- `script` (`string`)

## Returns

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

## Defined on

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