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

Rewrite the MongoDB integration article. #2178

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/database/includes/postgresql-app-host.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ To add an init bind mount to the PostgreSQL server resource, call the <xref:Aspi
var builder = DistributedApplication.CreateBuilder(args);

var postgres = builder.AddPostgres("postgres")
.WithInitBindMount(source: @"C:\PostgreSQL\Init");
.WithInitBindMount(@"C:\PostgreSQL\Init");

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

Expand All @@ -146,7 +146,7 @@ var exampleProject = builder.AddProject<Projects.ExampleProject>()
// After adding all resources, run the app...
```

The init bind mount relies on the host machine's filesystem to initialize the PostgreSQL server database with the containers _init_ folder. This folder is used for initialization, running any executable shell scripts or _.sql_ command files after the _postgres-data_ folder is created. The init bind mount is mounted at the `C:\PostgreSQL\Data` on Windows (or `/PostgreSQL/Data` on Unix) path on the host machine in the PostgreSQL server container.
The init bind mount relies on the host machine's filesystem to initialize the PostgreSQL server database with the containers _init_ folder. This folder is used for initialization, running any executable shell scripts or _.sql_ command files after the _postgres-data_ folder is created. The init bind mount is mounted at the `C:\PostgreSQL\Init` on Windows (or `/PostgreSQL/Init` on Unix) path on the host machine in the PostgreSQL server container.

### Add PostgreSQL server resource with parameters

Expand Down
14 changes: 9 additions & 5 deletions docs/database/includes/sql-app-host.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-pac

### Add SQL Server resource and database resource

In your app host project, call <xref:Aspire.Hosting.SqlServerBuilderExtensions.AddSqlServer*> to add and return a SQL Server resource builder. Chain a call to the returned resource build to <xref:Aspire.Hosting.SqlServerBuilderExtensions.AddDatabase*>, to add SQL Server database resource.
In your app host project, call <xref:Aspire.Hosting.SqlServerBuilderExtensions.AddSqlServer*> to add and return a SQL Server resource builder. Chain a call to the returned resource builder to <xref:Aspire.Hosting.SqlServerBuilderExtensions.AddDatabase*>, to add SQL Server database resource.

```csharp
var builder = DistributedApplication.CreateBuilder(args);
Expand All @@ -34,7 +34,8 @@ var sql = builder.AddSqlServer("sql")
var db = sql.AddDatabase("database");

builder.AddProject<Projects.ExampleProject>()
.WithReference(db);
.WithReference(db)
.WaitFor(db);

// After adding all resources, run the app...
```
Expand Down Expand Up @@ -72,7 +73,8 @@ var sql = builder.AddSqlServer("sql")
var db = sql.AddDatabase("database");

builder.AddProject<Projects.ExampleProject>()
.WithReference(db);
.WithReference(db)
.WaitFor(db);

// After adding all resources, run the app...
```
Expand All @@ -95,7 +97,8 @@ var sql = builder.AddSqlServer("sql")
var db = sql.AddDatabase("database");

builder.AddProject<Projects.ExampleProject>()
.WithReference(db);
.WithReference(db)
.WaitFor(db);

// After adding all resources, run the app...
```
Expand All @@ -117,7 +120,8 @@ var sql = builder.AddSqlServer("sql", password);
var db = sql.AddDatabase("database");

builder.AddProject<Projects.ExampleProject>()
.WithReference(db);
.WithReference(db)
.WaitFor(db);

// After adding all resources, run the app...
```
Expand Down
Loading
Loading