# SurrealDbNamespaceResource

- 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 namespace that is a child of a SurrealDB container resource.

## Definition

```go
type SurrealDbNamespaceResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
    ResourceWithParent
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`
- `ResourceWithParent`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the SurrealDB database.
- `Databases`: `map[string]string` `get` -- A dictionary where the key is the resource name and the value is the database name.
- `NamespaceName`: `string` `get` -- Gets the namespace name.
- `Parent`: [`SurrealDbServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md) `get` -- Gets the parent SurrealDB container resource.

## Methods

- [AddDatabase](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbnamespaceresource/adddatabase.md) -- `method` -- Adds a SurrealDB database resource to the application model
  ```go
  AddDatabase(name string, options ...*AddDatabaseOptions) SurrealDbDatabaseResource
  ```
- [WithCreationScript](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbnamespaceresource/withcreationscript.md) -- `method` -- Defines the SQL script used to create the namespace.
  ```go
  WithCreationScript(script string) SurrealDbNamespaceResource
  ```
