# SurrealDbDatabaseResource

- Module: [CommunityToolkit.Aspire.Hosting.SurrealDb](/reference/api/typescript/communitytoolkit.aspire.hosting.surrealdb.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

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

## Definition

```typescript
interface SurrealDbDatabaseResource
  extends IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParent,
    SurrealDbNamespaceResource]],
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databaseName: string;
  readonly parent: SurrealDbNamespaceResource;
  withCreationScript(script: string): SurrealDbDatabaseResource;
}
```

## Properties

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

## Methods

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