# PostgresServerResource.WithInitFiles

- Module: [Aspire.Hosting.PostgreSQL](/reference/api/go/aspire.hosting.postgresql.md)
- Defined on: [PostgresServerResource](/reference/api/go/aspire.hosting.postgresql/postgresserverresource.md)
- Version: `17.0.0`
- Kind: `method`

Copies init files to a PostgreSQL container resource.

## Definition

```go
type PostgresServerResource interface {
    // ... omitted for brevity
    WithInitFiles(source string) PostgresServerResource
}
```

## Signature

```go
WithInitFiles(source string) PostgresServerResource
```

## Parameters

- `source` (`string`) -- The source directory or files on the host to copy into the container.

## Returns

[`PostgresServerResource`](/reference/api/go/aspire.hosting.postgresql/postgresserverresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [PostgresServerResource](/reference/api/go/aspire.hosting.postgresql/postgresserverresource.md) -- `handle`
