# WithDataVolume

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

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

## Definition

```go
func (DbGateContainerResource) 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()`.

## Applies to

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