You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To integrate open source Supabase as a hosted resource in a .NET Aspire application:
Install the 'Aspire.Hosting.Supabase' NuGet package:
'dotnet add package Aspire.Hosting.Supabase'
Add the Supabase server resource in the app host project:
varbuilder=DistributedApplication.CreateBuilder(args);// Add Supabase server resourcevarsb=builder.AddSupabase("supabase");// Add a Supabase databasevarsbDb=sb.AddDatabase("supabasedb");// Reference the Supabase database in a projectvarexampleProject=builder.AddProject<Projects.ExampleProject>().WithReference(sbDb);// Initialize and run the applicationbuilder.Build().Run();
To enable client projects to connect to Supabase :
Install the Aspire.Supabase NuGet package:
dotnet add package Aspire.Supabase
Add the Supabase client to the Program.cs file in the client project:
builder.AddSupabaseDataSource("sbdb"));
Both integrations should align with Aspire's existing conventions and provide a similar experience to the PostgreSQL integration.
Related to an existing integration?
Yes
Existing integration
https://github.com/dotnet/aspire/tree/main/src/Aspire.Hosting.PostgreSQL
Overview
.NET Aspire issue link
dotnet/aspire#4271
Overview
The Aspire framework does not currently support Supabase, a modern, open-source serverless PostgreSQL-compatible database. It has .NET client packages for C# here https://supabase.com/docs/reference/csharp/introduction
Usage example
To integrate open source Supabase as a hosted resource in a .NET Aspire application:
Install the 'Aspire.Hosting.Supabase' NuGet package:
'dotnet add package Aspire.Hosting.Supabase'
Add the Supabase server resource in the app host project:
To enable client projects to connect to Supabase :
Install the
Aspire.Supabase
NuGet package:dotnet add package Aspire.Supabase
Add the Supabase client to the Program.cs file in the client project:
builder.AddSupabaseDataSource("sbdb"));
Both integrations should align with Aspire's existing conventions and provide a similar experience to the PostgreSQL integration.
Breaking change?
No
Alternatives
Not that I can find.
Additional context
Links
https://supabase.com/docs
https://supabase.com/docs/guides/self-hosting/docker
Help us help you
No, just wanted to propose this
The text was updated successfully, but these errors were encountered: