# DbGateContainerResource.WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.DbGate](/reference/api/go/communitytoolkit.aspire.hosting.dbgate.md)
- Defined on: [DbGateContainerResource](/reference/api/go/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md)
- Version: `13.6.1`
- Kind: `method`

Adds a named volume for the data folder to a DbGate container resource.

## Definition

```go
type DbGateContainerResource interface {
    // ... omitted for brevity
    WithDataVolume(options ...*WithDataVolumeOptions) DbGateContainerResource
}
```

## Signature

```go
WithDataVolume(options ...*WithDataVolumeOptions) DbGateContainerResource
```

## Parameters

- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithDataVolumeOptions` argument.

- `Name` (`*string`) -- The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `IsReadOnly` (`*bool`) -- A flag that indicates if this is a read-only volume.

## Returns

[`DbGateContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md) -- The `IResourceBuilder`.

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

## Defined on

- [DbGateContainerResource](/reference/api/go/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md) -- `handle`
