SurrealDbNamespaceResource

Handle
📦 CommunityToolkit.Aspire.Hosting.SurrealDb v13.6.1

A resource that represents a SurrealDB namespace that is a child of a SurrealDB container resource.

type SurrealDbNamespaceResource interface {
ExpressionValue
Resource
ResourceWithConnectionString
ResourceWithParent
}

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection string expression for the SurrealDB database.
ConnectionStringExpression() *ReferenceExpression
propertyDatabasesmap[string]stringget
A dictionary where the key is the resource name and the value is the database name.
Databases() (map[string]string, error)
propertyNamespaceNamestringget
Gets the namespace name.
NamespaceName() (string, error)
propertyParentSurrealDbServerResourceget
Gets the parent SurrealDB container resource.
Parent() SurrealDbServerResource

Methods

methodAddDatabasebuilder
Adds a SurrealDB database resource to the application model
AddDatabase(
name string,
options ...*AddDatabaseOptions,
) SurrealDbDatabaseResource
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
options...*AddDatabaseOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddDatabaseOptions argument.

DatabaseName*stringThe name of the database. If not provided, this defaults to the same value as name.
SurrealDbDatabaseResource

A reference to the IResourceBuilder.

Returns a handle; failures surface later via Err().

methodWithCreationScriptbuilder
Defines the SQL script used to create the namespace.
WithCreationScript(script string) SurrealDbNamespaceResource
scriptstringThe SQL script used to create the namespace.
SurrealDbNamespaceResource

A reference to the IResourceBuilder.

Returns a handle; failures surface later via Err().