# withReadOnly

- Module: [CommunityToolkit.Aspire.Hosting.DuckDB](/reference/api/typescript/communitytoolkit.aspire.hosting.duckdb.md)
- Version: `13.6.1`
- Kind: `method`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Configures the DuckDB resource to open the database in read-only mode.

## Definition

```typescript
interface DuckDBResource {
  // ... omitted for brevity
  withReadOnly(): DuckDBResource
}
```

## Returns

[DuckDBResource](/reference/api/typescript/communitytoolkit.aspire.hosting.duckdb/duckdbresource.md) `builder`

## Applies to

- [DuckDBResource](/reference/api/typescript/communitytoolkit.aspire.hosting.duckdb/duckdbresource.md)
