# SqlProjectResource

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

Represents a SQL Server Database project resource.

## Definition

```go
type SqlProjectResource interface {
    Resource
    ResourceWithWaitSupport
}
```

## Embeds

- `Resource`
- `ResourceWithWaitSupport`

## 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`: `bool` `get` -- Gets a value indicating whether deployment should be skipped when the dacpac has already been deployed.

## Methods

- [WithConnectionReference](/reference/api/go/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withconnectionreference.md) -- `method` -- Publishes the SQL Server database project to a connection string resource.
  ```go
  WithConnectionReference(target ResourceWithConnectionString) SqlProjectResource
  ```
- [WithDacDeployOptions](/reference/api/go/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withdacdeployoptions.md) -- `method` -- Sets the publish profile path used for DAC deployment options.
  ```go
  WithDacDeployOptions(optionsPath string) SqlProjectResource
  ```
- [WithDacpac](/reference/api/go/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withdacpac.md) -- `method` -- Specifies the path to the .dacpac file.
  ```go
  WithDacpac(dacpacPath string) SqlProjectResource
  ```
- [WithReference](/reference/api/go/communitytoolkit.aspire.hosting.sqldatabaseprojects/sqlprojectresource/withreference.md) -- `method` -- Publishes the SQL Server database project to a SQL Server database resource.
  ```go
  WithReference(target SqlServerDatabaseResource) SqlProjectResource
  ```
- [WithSkipWhenDeployed](/reference/api/go/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.
  ```go
  WithSkipWhenDeployed() SqlProjectResource
  ```
