# SurrealDbDatabaseResource

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

## Definition

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

## Embeds

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

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the SurrealDB database.
- `DatabaseName`: `string` `get` -- Gets the database name.
- `Parent`: [`SurrealDbNamespaceResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbnamespaceresource.md) `get` -- Gets the parent SurrealDB namespace resource.

## Methods

- [WithCreationScript](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbdatabaseresource/withcreationscript.md) -- `method` -- Defines the SQL script used to create the database.
  ```go
  WithCreationScript(script string) SurrealDbDatabaseResource
  ```
