Skip to content

Database container with multiple database schema #3799

@wangkanai

Description

@wangkanai

Currently I can only add a single database schema per container.

using Gsb.AppHost.Constants;

var builder = DistributedApplication.CreateBuilder(args);

var sqlMySql = builder.AddMySql(ResourceConstants.SqlMySql)
                      .WithEnvironment(DatabaseConstants.MySqlConnection, ResourceConstants.SqlMySql)
                      .AddDatabase(SchemaConstants.Configuration);

Preferred solution with multiple database schema per container.

using Gsb.AppHost.Constants;

var builder = DistributedApplication.CreateBuilder(args);

var sqlMySql = builder.AddMySql(ResourceConstants.SqlMySql)
                      .WithEnvironment(DatabaseConstants.MySqlConnection, ResourceConstants.SqlMySql)
                      .AddDatabase(SchemaConstants.Configuration)
                      .AddDatabase(SchemaConstants.Customers)
                      .AddDatabase(SchemaConstants.Laywers);

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packagesmysqlIssues related to MySQL integrations

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions