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

Code snippet for adding Postgres to an Aspire project is broken #2103

Open
manio143 opened this issue Nov 17, 2024 · 0 comments
Open

Code snippet for adding Postgres to an Aspire project is broken #2103

manio143 opened this issue Nov 17, 2024 · 0 comments

Comments

@manio143
Copy link

Type of issue

Code doesn't work

Description

In Add PostgreSQL server resource section there's a reference to this code:

var postgres = builder.AddPostgres("postgres");
var postgresdb = postgres.AddDatabase("postgresdb");

Unless you use EF Core with database creation on launch, this example will not work out of the box. For example, I'm using Marten and I'm getting an error back that Database postgresdb doesn't exist. See dotnet/aspire#1170 for more context.

IMO, the default sample in the docs should provide code that works out of the box, without depending on other libraries the user may or may not choose to use. At the very least, there should be a warning section added to the article which mentions that the database will not be created.

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/database/postgresql-integration?tabs=dotnet-cli

Content source URL

https://github.com/dotnet/docs-aspire/blob/main/docs/database/postgresql-integration.md

Document Version Independent Id

7e347326-fccf-e227-1509-b45fbfe94ba3

Article author

@CamSoper

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