# SqlProjectResource

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

Represents a SQL Server Database project resource.

## Definition

```typescript
interface SqlProjectResource
  extends IResource,
    IResourceWithDacpac,
    IResourceWithWaitSupport {
  readonly dacDeployOptionsPath: string;
  readonly dacpacPath: string;
  readonly skipWhenDeployed: boolean;
  withConnectionReference(target: IResourceWithConnectionString): SqlProjectResource;
  withDacDeployOptions(optionsPath: string): SqlProjectResource;
  withDacpac(dacpacPath: string): SqlProjectResource;
  withReference(target: SqlServerDatabaseResource): SqlProjectResource;
  withSkipWhenDeployed(): SqlProjectResource;
}
```

## Properties

- `dacDeployOptionsPath`: `string` `get` -- Gets the configured path to the deployment options publish profile.
- `dacpacPath`: `string` `get` -- Gets the configured path to the .dacpac file.
- `skipWhenDeployed`: `boolean` `get` -- Gets a value indicating whether deployment should be skipped when the dacpac has already been deployed.

## Methods

- [withConnectionReference](/reference/api/typescript/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withconnectionreference.md) -- `method` -- Publishes the SQL Server database project to a connection string resource.
    ```typescript
  withConnectionReference(target: IResourceWithConnectionString): SqlProjectResource
  ```
- [withDacDeployOptions](/reference/api/typescript/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withdacdeployoptions.md) -- `method` -- Sets the publish profile path used for DAC deployment options.
    ```typescript
  withDacDeployOptions(optionsPath: string): SqlProjectResource
  ```
- [withDacpac](/reference/api/typescript/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withdacpac.md) -- `method` -- Specifies the path to the .dacpac file.
    ```typescript
  withDacpac(dacpacPath: string): SqlProjectResource
  ```
- [withReference](/reference/api/typescript/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withreference.md) -- `method` -- Publishes the SQL Server database project to a SQL Server database resource.
    ```typescript
  withReference(target: SqlServerDatabaseResource): SqlProjectResource
  ```
- [withSkipWhenDeployed](/reference/api/typescript/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withskipwhendeployed.md) -- `method` -- Specifies that .dacpac deployment should be skipped if metadata in the target database indicates that the .dacpac has already been deployed in its current state.
    ```typescript
  withSkipWhenDeployed(): SqlProjectResource
  ```
