Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to publish SQL Database Projects to existing SQL server #389

Open
ErikEJ opened this issue Jan 14, 2025 · 0 comments
Open

Add ability to publish SQL Database Projects to existing SQL server #389

ErikEJ opened this issue Jan 14, 2025 · 0 comments

Comments

@ErikEJ
Copy link
Contributor

ErikEJ commented Jan 14, 2025

Related to an existing integration?

Yes

Existing integration

CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects

Overview

According to the docs, you should use AddConnectionString to connect to an existing SQL Server instance

This prevents SQL project publishing from working, as .WithReference only accepts IResourceBuilder<SqlServerDatabaseResource> and AddConnectionString returns IResourceBuilder<IResourceWithConnectionString>

Unsure how to solve, maybe add an WithReference overload that accepts a IResourceBuilder<IResourceWithConnectionString> ?

Happy to do a PR once we agree on a design (and agree that this add value / makes sense)

@jmezach FYI

Usage example

var builder = DistributedApplication.CreateBuilder(args);

var connection = builder.AddConnectionString("Default");

builder.AddSqlProject<Projects.SdkProject>("sdk-project")
       .WithReference(connection);

Breaking change?

No

Alternatives

I seem to be forced to use a SQL container at the moment

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant