Skip to content

Add built-in support for CockroachDB in Aspire CommunityToolkit #700

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

Open
max2020204 opened this issue May 26, 2025 · 0 comments
Open

Add built-in support for CockroachDB in Aspire CommunityToolkit #700

max2020204 opened this issue May 26, 2025 · 0 comments

Comments

@max2020204
Copy link

Related to an existing integration?

Yes

Existing integration

PostgreSQL (Aspire.Hosting.PostgreSQL)

Overview

Aspire currently supports PostgreSQL with a rich container resource builder (AddPostgres(), AddDatabase(), health checks, etc). It would be very beneficial to support CockroachDB as well, since it’s PostgreSQL-wire compatible, resilient, and designed for distributed workloads.

CockroachDB is often used in scalable microservice environments and cloud-native platforms. Adding a first-class integration in the CommunityToolkit would empower users to adopt Aspire in more distributed and elastic workloads.

Usage example

var cockroach = builder.AddCockroachDB("crdb")
.WithDataVolume()
.WithHostPort(26257);

builder.AddProject<Projects.Api>("api")
.WithReference(cockroach)
.WaitFor(cockroach);

Breaking change?

No

Alternatives

Today, users can manually use .AddContainer("cockroachdb") with a custom port and args, but this loses health checks, parameter binding, and resource modeling available in the PostgreSQL integration.

Additional context

CockroachDB works out-of-the-box with most PostgreSQL drivers (e.g., Npgsql), and supports SQL with some limitations (e.g., serial vs GENERATED). Providing official support would help standardize its usage across Aspire-based projects.

Help us help you

Yes, but only if others can assist

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