# CommunityToolkit.Aspire.Hosting.SurrealDb

- Module: `CommunityToolkit.Aspire.Hosting.SurrealDb`
- Version: `13.6.1`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)
- Functions: `11`
- Types: `3`

## Handles

- [SurrealDbDatabaseResource](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbdatabaseresource.md) -- `handle` - 4 members -- A resource that represents a SurrealDB database that is a child of a SurrealDB namespace resource.
- [SurrealDbNamespaceResource](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbnamespaceresource.md) -- `handle` - 6 members -- A resource that represents a SurrealDB namespace that is a child of a SurrealDB container resource.
- [SurrealDbServerResource](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md) -- `handle` - 15 members -- A resource that represents a SurrealDB container.

## Functions

- [AddSurrealServer](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/addsurrealserver.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a SurrealDB resource to the application model. A container is used for local development. The default image is and the tag is .
- [WithCreationScript](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withcreationscript-surrealdbdatabaseresource-string.md) -- `method` - on `SurrealDbDatabaseResource` -- Defines the SQL script used to create the database.
- [AddDatabase](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/adddatabase.md) -- `method` - on `SurrealDbNamespaceResource` -- Adds a SurrealDB database resource to the application model
- [WithCreationScript](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withcreationscript-surrealdbnamespaceresource-string.md) -- `method` - on `SurrealDbNamespaceResource` -- Defines the SQL script used to create the namespace.
- [AddNamespace](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/addnamespace.md) -- `method` - on `SurrealDbServerResource` -- Adds a SurrealDB namespace resource to the application model
- [WithDataBindMount](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withdatabindmount.md) -- `method` - on `SurrealDbServerResource` -- Adds a bind mount for the data folder to a SurrealDB resource.
- [WithDataVolume](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withdatavolume.md) -- `method` - on `SurrealDbServerResource` -- Adds a named volume for the data folder to a SurrealDB resource.
- [WithInitFiles](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withinitfiles.md) -- `method` - on `SurrealDbServerResource` -- Copies init files into a SurrealDB container resource.
- [WithLogLevel](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withloglevel.md) -- `method` - on `SurrealDbServerResource`
- [WithSurrealDbOtlpExporter](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withsurrealdbotlpexporter.md) -- `method` - on `SurrealDbServerResource` -- 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.
- [WithSurrealist](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/withsurrealist.md) -- `method` - on `SurrealDbServerResource`
