Configures ABP connection strings for modular and multi-tenant apps: Default connection, per-module databases, grouping modules into one database, and per-tenant database routing.
Ships in abp-data-access. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ABP's connection string system is designed for modular and multi-tenant apps: every module can point at its own physical database, and every tenant can use a separate database. A single monolithic app with one DB just uses Default.
Default connection for a single-database app.DbContext to a named connection string via [ConnectionStringName].AbpDbConnectionOptions.Databases.IConnectionStringResolver.DbContext registration or model configuration — use ef-core-integration.Default is the fallback. If a module has no connection string of its own, ABP uses Default. The layered startup template ships with only Default, so all modules share one database.
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyMainDb;Trusted_Connection=True;"
}
Give a module its own database by adding a named entry. The name matches the module's connection string name:
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyMainDb;Trusted_Connection=True;",
"AbpIdentity": "Server=localhost;Database=MyIdentityDb;Trusted_Connection=True;",
"AbpPermissionManagement": "Server=localhost;Database=MyPermissionDb;Trusted_Connection=True;"
}
Pre-built modules expose their connection string name as a constant (e.g. AbpOpenIddictDbProperties.ConnectionStringName in the Volo.Abp.OpenIddict namespace — for older solutions on IdentityServer it's AbpIdentityServerDbProperties) — use the constant instead of a magic string.
Annotate the DbContext (and its interface, if any) with [ConnectionStringName]. ABP then resolves that named connection string for this context. Applies to both EF Core and MongoDB:
[ConnectionStringName("MyModule")]
public class MyModuleDbContext
: AbpDbContext<MyModuleDbContext>, IMyModuleDbContext
{
}
Instead of repeating the same connection string for several modules, map them to a shared database via AbpDbConnectionOptions.Databases in your module's ConfigureServices:
Configure<AbpDbConnectionOptions>(options =>
{
options.Databases.Configure("MySecondaryDb", db =>
{
db.MappedConnections.Add("AbpIdentity");
db.MappedConnections.Add("AbpOpenIddict");
db.MappedConnections.Add("AbpPermissionManagement");
});
});
Then appsettings.json only needs the grouped name:
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyMainDb;Trusted_Connection=True;",
"MySecondaryDb": "Server=localhost;Database=MySecondaryDb;Trusted_Connection=True;"
}
You can also set/override connection strings in code (options pattern):
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = "...";
options.ConnectionStrings["AbpPermissionManagement"] = "...";
});
Resolution order: ABP looks for (1) the module-specific connection string, then (2) a database mapping, then (3) falls back to Default.
Whenever ABP needs a connection string it calls IConnectionStringResolver (from Volo.Abp.Data):
public interface IConnectionStringResolver
{
Task<string> ResolveAsync(string? connectionStringName = null);
[Obsolete("Use ResolveAsync method.")]
string Resolve(string? connectionStringName = null);
}
Use ResolveAsync — Resolve is obsolete. Two built-in implementations:
DefaultConnectionStringResolver — resolves from AbpDbConnectionOptions using the rules above.MultiTenantConnectionStringResolver — for multi-tenant apps; layers tenant-specific resolution on top of DefaultConnectionStringResolver and reads tenant connection strings from ITenantStore. If there is no current tenant, or the tenant defined no connection strings, it falls back entirely to the base (DefaultConnectionStringResolver) logic.In a multi-tenant SaaS app, MultiTenantConnectionStringResolver routes each tenant to its own database automatically. For the current tenant it looks up the tenant's connection strings in the tenant store and resolves in this order:
connectionStringName null or Default): the tenant's own Default if set, otherwise the global Default.Default, and only then (4) fall back to the base DefaultConnectionStringResolver (global named → database mapping → global Default).So a named request does not simply fall back to Default — it walks the tenant-specific chain first. Configure a tenant's connection string in the tenant management UI/data so its requests hit a separate database. See the multi-tenancy docs for using separate databases per tenant.
If you need custom logic to pick a connection string, implement IConnectionStringResolver (optionally deriving from one of the built-ins) and replace the registration via ABP's dependency injection system.
appsettings.json wins over Default; a module with no named entry falls back to Default.MySecondaryDb).Default.AbpOpenIddictDbProperties.ConnectionStringName), so a rename in the module doesn't silently break resolution.Resolve is obsolete — always call ResolveAsync.Default under multi-tenancy — MultiTenantConnectionStringResolver walks the full tenant-specific chain (exact name → mapped database → tenant Default → global) before the global Default.[ConnectionStringName] on a DbContext (and its interface) leaves it resolving Default instead of its intended named database.What SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/apply-data-filtersWork with ABP data filters — the built-in ISoftDelete and IMultiTenant filters, toggling them via IDataFilter scopes, changing default states, and defining custom global query filters for EF Core or MongoDB. USE FOR: reading/writing soft-deleted or cross-tenant data with IDataFilter.Disable/Enable, checking IsEnabled, HardDeleteAsync, changing AbpDataFilterOptions defaults, defining a custom marker-interface filter, wiring it in EF Core (ShouldFilterEntity/CreateFilterExpression/HasAbpQueryFilter) or MongoDB (MongoDbRepositoryFilterer/FilterQueryable). DO NOT USE FOR: switching the active tenant context via ICurrentTenant.Change (that is the multi-tenancy concern); defining a DbContext/repositories or EF Core migrations (use ef-core-integration); MongoDB DbContext/repository setup (use mongodb-integration); transaction/UOW boundaries (use manage-units-of-work); optimistic concurrency (use handle-optimistic-concurrency).
/ef-core-integrationIntegrate Entity Framework Core into an ABP application: AbpDbContext, AddAbpDbContext registration, default/custom repositories, and code-first migrations with DbMigrator. USE FOR: defining an AbpDbContext with ConfigureByConvention, registering it via AddAbpDbContext, wiring AddDefaultRepositories/AddRepository, writing custom EfCoreRepository classes, resolving the active DbContext via IDbContextProvider, adding dotnet ef migrations, running the DbMigrator. DO NOT USE FOR: consuming the standard IRepository method surface — Get/Find/WithDetails/queryable/bulk (use-abp-repositories); MongoDB integration (use mongodb-integration); controlling transaction/UOW boundaries (use manage-units-of-work); soft-delete/multi-tenant/custom query filters (use apply-data-filters); optimistic concurrency stamps (use handle-optimistic-concurrency); Dapper queries (use query-with-dapper); connection-string resolution/config (use configure-connection-strings); seeding data via IDataSeeder (use seed-application-data).
/handle-optimistic-concurrencyEnable and handle ABP optimistic concurrency control so concurrent updates to the same record are detected and rejected. USE FOR: enabling concurrency with IHasConcurrencyStamp/ConcurrencyStamp, deriving from aggregate root base classes to get it for free, flowing the stamp through output and update DTOs, handling AbpDbConcurrencyException when two users update the same record. DO NOT USE FOR: EF-Core-specific mapping/change tracking (use ef-core-integration), MongoDB provider setup (use mongodb-integration), unit-of-work flush/transaction control (use manage-units-of-work), general validation/error surfacing (use handle-validation-and-errors).
/manage-units-of-workControl ABP's Unit of Work — transaction and connection scope, explicit UOW scopes, the [UnitOfWork] attribute, and mid-scope SaveChangesAsync. USE FOR: starting explicit scopes with IUnitOfWorkManager.Begin, applying [UnitOfWork], choosing transactional vs non-transactional boundaries, calling SaveChangesAsync mid-scope, working with nested/RequiresNew/reserved scopes, reading IUnitOfWorkManager.Current, using OnCompleted/CompleteAsync/RollbackAsync. DO NOT USE FOR: defining a DbContext or repositories, or EF Core migrations (use ef-core-integration); MongoDB DbContext/repositories (use mongodb-integration); soft-delete/multi-tenant/custom query filters (use apply-data-filters); optimistic concurrency stamps (use handle-optimistic-concurrency); connection-string resolution (use configure-connection-strings).
/mongodb-integrationIntegrate MongoDB into an ABP application: AbpMongoDbContext, collection mapping, AddMongoDbContext registration, and custom Mongo repositories. USE FOR: defining an AbpMongoDbContext, mapping collections with [MongoCollection]/CreateModel, registering via AddMongoDbContext, wiring AddDefaultRepositories/AddRepository, writing custom MongoDbRepository classes, reaching the DbContext via IMongoDbContextProvider, using GetCollectionAsync/GetAggregateAsync. DO NOT USE FOR: consuming standard IRepository methods (use-abp-repositories); Entity Framework Core integration, DbContext model builder, or code-first migrations (use ef-core-integration); controlling transaction/UOW boundaries (use manage-units-of-work); soft-delete/multi-tenant/custom query filters or MongoDbRepositoryFilterer (use apply-data-filters); optimistic concurrency (use handle-optimistic-concurrency); connection-string configuration (use configure-connection-strings); seeding data via IDataSeeder (use seed-application-data).
/query-with-dapperRun raw SQL via Dapper inside an ABP repository for hot-path read/aggregate queries while sharing ABP's unit of work, connection, and transaction. USE FOR: complex or slow queries where EF Core's generated SQL is too slow, hand-written SQL you want full control over, deriving from a DbContext-based DapperRepository and using GetDbConnectionAsync/GetDbTransactionAsync to stay in the current unit of work. DO NOT USE FOR: standard CRUD/LINQ/change tracking/migrations (use ef-core-integration), MongoDB queries (use mongodb-integration), unit-of-work configuration itself (use manage-units-of-work), connection string routing (use configure-connection-strings).
/abp-data-access:configure-connection-stringsfrom abp-data-access
npx claudepluginhub abpframework/abp-skills --plugin abp-data-accessOther plugins' skills for the same job