Skip to content
DocsTry Aspire
DocsTry

CommunityToolkit.Aspire.Hosting.SurrealDb

📦 CommunityToolkit.Aspire.Hosting.SurrealDbv13.4.0
11Functions
3Types

Types

Functions

methodaddDatabasebuilder
Adds a SurrealDB database resource to the application model
addDatabase(name: string, databaseName?: string): SurrealDbDatabaseResource
methodaddNamespacebuilder
Adds a SurrealDB namespace resource to the application model
addNamespace(name: string, namespaceName?: string): SurrealDbNamespaceResource
methodaddSurrealServerbuilder
Adds a SurrealDB resource to the application model. A container is used for local development. The default image is and the tag is .
addSurrealServer(name: string, userName?: ParameterResource, password?: ParameterResource, port?: number, path?: string, strictMode?: boolean): SurrealDbServerResource
methodwithCreationScriptbuilder
Defines the SQL script used to create the namespace.
withCreationScript(script: string): SurrealDbNamespaceResource
methodwithCreationScriptbuilder
Defines the SQL script used to create the database.
withCreationScript(script: string): SurrealDbDatabaseResource
methodwithDataBindMountbuilder
Adds a bind mount for the data folder to a SurrealDB resource.
withDataBindMount(source: string): SurrealDbServerResource
methodwithDataVolumebuilder
Adds a named volume for the data folder to a SurrealDB resource.
withDataVolume(name?: string): SurrealDbServerResource
methodwithInitFilesbuilder
Copies init files into a SurrealDB container resource.
withInitFiles(source: string): SurrealDbServerResource
methodwithLogLevelbuilder
withLogLevel(logLevel: string): SurrealDbServerResource
methodwithSurrealDbOtlpExporterbuilder
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.
withSurrealDbOtlpExporter(): SurrealDbServerResource
methodwithSurrealistbuilder
withSurrealist(containerName?: string): SurrealDbServerResource