# SurrealDbServerResource

- Module: [CommunityToolkit.Aspire.Hosting.SurrealDb](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb.md)
- Version: `13.6.1`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

A resource that represents a SurrealDB container.

## Definition

```go
type SurrealDbServerResource interface {
    ExpressionValue
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithConnectionString
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the SurrealDB instance.
- `Host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `Namespaces`: `map[string]string` `get` -- A dictionary where the key is the resource name and the value is the namespace name.
- `PasswordParameter`: `ParameterResource` `get` -- Gets the parameter that contains the SurrealDB password.
- `Port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `PrimaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the SurrealDB instance.
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the SurrealDB instance.
- `UserNameParameter`: `ParameterResource` `get` -- Gets the parameter that contains the SurrealDB username.

## Methods

- [AddNamespace](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/addnamespace.md) -- `method` -- Adds a SurrealDB namespace resource to the application model
  ```go
  AddNamespace(name string, options ...*AddNamespaceOptions) SurrealDbNamespaceResource
  ```
- [WithDataBindMount](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a SurrealDB resource.
  ```go
  WithDataBindMount(source string) SurrealDbServerResource
  ```
- [WithDataVolume](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a SurrealDB resource.
  ```go
  WithDataVolume(options ...*WithDataVolumeOptions) SurrealDbServerResource
  ```
- [WithInitFiles](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/withinitfiles.md) -- `method` -- Copies init files into a SurrealDB container resource.
  ```go
  WithInitFiles(source string) SurrealDbServerResource
  ```
- [WithLogLevel](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/withloglevel.md) -- `method`
  ```go
  WithLogLevel(logLevel string) SurrealDbServerResource
  ```
- [WithSurrealDbOtlpExporter](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/withsurrealdbotlpexporter.md) -- `method` -- Injects the appropriate environment variables to allow the resource to enable sending telemetry to the dashboard. 1. It sets the OTLP endpoint to the value of the DOTNET_DASHBOARD_OTLP_ENDPOINT_URL environment variable. 2. It sets the service name and instance id to the resource name and UID. Values are injected by the orchestrator. 3. It sets a small batch schedule delay in development. This reduces the delay that OTLP exporter waits to sends telemetry and makes the dashboard telemetry pages responsive.
  ```go
  WithSurrealDbOtlpExporter() SurrealDbServerResource
  ```
- [WithSurrealist](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/withsurrealist.md) -- `method`
  ```go
  WithSurrealist(options ...*WithSurrealistOptions) SurrealDbServerResource
  ```
