Configures the Orchard Core data layer: database provider selection, YesSql/SQLite options, table naming, connection strings, Dapper integration, and 4.0 config section renames.
Ships in orchardcore. 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.
You are an Orchard Core expert. Generate code and configuration for database access, YesSql settings, Dapper queries, connection management, and table prefix handling.
ExclusiveToDocumentType() and SingleRecordPerDocument() when true, and IQuery<T>.NoDuplicates() is obsolete in favor of SkipDeduplication(); see orchardcore-yessql-indexes.Sqlite (default), SqlConnection (SQL Server), Postgres, MySql. For SQL Server, MySQL and PostgreSQL, create the database first; Orchard Core creates the tables, not the database.IShellConfiguration).IContentManager for content items and ISession for YesSql documents and indexes; use raw SQL only for custom relational tables.IDbConnectionAccessor (OrchardCore.Data, package OrchardCore.Data.Abstractions) to create DbConnection instances pointing to the tenant database.IStore.Configuration for the SqlDialect, TablePrefix (already includes the separator) and Schema.dialect.QuoteForTableName(name, schema) so tenants with a schema work too.orchardcore-data-migrations).OrchardCore and, since Orchard Core 4.0, are named YesSql, Data:Sqlite, Data:TableOptions and Documents.{ "steps": [...] }.sealed modifier, except view models.The DatabaseName shell setting controls the SQLite file name (OrchardCore.db by default) in the tenant's data folder.
Microsoft.Data.Sqlite pools connections by default. Disable it when file locking interferes with copying or replacing the database file (for example backups); this can reduce performance:
{
"OrchardCore": {
"Data": {
"Sqlite": {
"UseConnectionPooling": false
}
}
}
}
OrchardCore:YesSql binds to YesSqlOptions (namespace OrchardCore.Data.YesSql).
| Setting | Description | Default |
|---|---|---|
CommandsPageSize | Max commands per command page before YesSql splits them | 500 |
QueryGatingEnabled | Coalesces identical concurrent queries and shares the result | true |
EnableThreadSafetyChecks | Helps diagnose concurrent use of a session | false |
IsolationLevel | Default transaction isolation level | ReadCommitted |
ConcurrentIndexCreationEnabled | Creates the indexes a data migration adds to an existing table without blocking writes: online on SQL Server editions that support online index operations (Enterprise, Developer, Azure SQL Database, Azure SQL Managed Instance) and with ALGORITHM=INPLACE, LOCK=NONE on MySQL. PostgreSQL still blocks writes (migrations run in a transaction) and SQLite creates indexes the regular way. Set to false to always create them the regular way | true |
IncludeQueryTextInTelemetry | Adds the SQL text (db.query.text) to YesSql command spans when the YesSql telemetry source is collected (see orchardcore-opentelemetry). Raw SQL fragments are included as is and can expose data to the telemetry receiver | false |
IdGenerator, IdentifierAccessorFactory, VersionAccessorFactory and ContentSerializer can only be set in code.
{
"OrchardCore": {
"YesSql": {
"CommandsPageSize": 1000,
"QueryGatingEnabled": true,
"EnableThreadSafetyChecks": false,
"IsolationLevel": "ReadCommitted",
"ConcurrentIndexCreationEnabled": true,
"IncludeQueryTextInTelemetry": false
}
}
}
In a tenant-local App_Data/Sites/{tenant}/appsettings.json, omit the outer OrchardCore section.
using OrchardCore.Data.YesSql;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.Configure<YesSqlOptions>(options =>
{
options.CommandsPageSize = 1000;
});
}
}
OrchardCore:Data:TableOptions holds presets copied into a tenant's shell settings during initial setup. Changing them later doesn't rename existing tables or alter identity columns.
| Setting | Description | Default |
|---|---|---|
DefaultDocumentTable | Document table name | Document |
DefaultTableNameSeparator | Separator between prefix/collection and table name (one or more _, or NULL for none) | _ |
DefaultIdentityColumnSize | Identity column size (Int32 or Int64) | Int64 |
{
"OrchardCore": {
"Data": {
"TableOptions": {
"DefaultDocumentTable": "Document",
"DefaultTableNameSeparator": "_",
"DefaultIdentityColumnSize": "Int64"
}
}
}
}
OrchardCore:Documents sets the shared options of the documents managed by IDocumentManager<TDocument> (site settings, content definitions, ...): CheckConcurrency and CheckConsistency (default true), SynchronizationLatency (default 1 second), FailoverRetryLatency (default 30 seconds), CompressThreshold (default 10,000 characters), and LockTimeout/LockExpiration (default 10,000 ms, atomic updates only).
{
"OrchardCore": {
"Documents": {
"SynchronizationLatency": "00:00:02"
}
}
}
using Dapper;
using OrchardCore.Data;
using YesSql;
public sealed class MyDataService
{
private readonly IDbConnectionAccessor _dbAccessor;
private readonly IStore _store;
public MyDataService(IDbConnectionAccessor dbAccessor, IStore store)
{
_dbAccessor = dbAccessor;
_store = store;
}
public async Task<int> GetRecordCountAsync(CancellationToken cancellationToken)
{
await using var connection = _dbAccessor.CreateConnection();
await connection.OpenAsync(cancellationToken);
var configuration = _store.Configuration;
var table = configuration.SqlDialect.QuoteForTableName($"{configuration.TablePrefix}MyTable", configuration.Schema);
return await connection.ExecuteScalarAsync<int>(
new CommandDefinition($"SELECT COUNT(*) FROM {table}", cancellationToken: cancellationToken));
}
}
using Dapper;
using OrchardCore.Data;
using YesSql;
public sealed class ProductRepository
{
private readonly IDbConnectionAccessor _dbAccessor;
private readonly IStore _store;
public ProductRepository(IDbConnectionAccessor dbAccessor, IStore store)
{
_dbAccessor = dbAccessor;
_store = store;
}
public async Task<IReadOnlyList<ProductRecord>> GetByCategoryAsync(string category, CancellationToken cancellationToken)
{
await using var connection = _dbAccessor.CreateConnection();
await connection.OpenAsync(cancellationToken);
var configuration = _store.Configuration;
// TablePrefix already contains the separator; pass the schema when quoting.
var tableName = configuration.SqlDialect.QuoteForTableName(
$"{configuration.TablePrefix}ProductRecord",
configuration.Schema);
var command = new CommandDefinition(
$"SELECT * FROM {tableName} WHERE Category = @Category",
new { Category = category },
cancellationToken: cancellationToken);
return (await connection.QueryAsync<ProductRecord>(command)).AsList();
}
}
Open the connection before beginning the transaction, pass the transaction to every command, and rethrow after rollback:
using Dapper;
using OrchardCore.Data;
using YesSql;
public sealed class OrderService
{
private readonly IDbConnectionAccessor _dbAccessor;
private readonly IStore _store;
public OrderService(IDbConnectionAccessor dbAccessor, IStore store)
{
_dbAccessor = dbAccessor;
_store = store;
}
public async Task ChangeStatusAsync(int orderId, string newStatus, CancellationToken cancellationToken)
{
var configuration = _store.Configuration;
var dialect = configuration.SqlDialect;
var ordersTable = dialect.QuoteForTableName($"{configuration.TablePrefix}Orders", configuration.Schema);
var auditTable = dialect.QuoteForTableName($"{configuration.TablePrefix}OrderAudit", configuration.Schema);
await using var connection = _dbAccessor.CreateConnection();
await connection.OpenAsync(cancellationToken);
await using var transaction = await connection.BeginTransactionAsync(cancellationToken);
try
{
await connection.ExecuteAsync(new CommandDefinition(
$"UPDATE {ordersTable} SET Status = @Status WHERE Id = @Id",
new { Status = newStatus, Id = orderId },
transaction,
cancellationToken: cancellationToken));
await connection.ExecuteAsync(new CommandDefinition(
$"INSERT INTO {auditTable} (OrderId, Action, Timestamp) VALUES (@OrderId, @Action, @Timestamp)",
new { OrderId = orderId, Action = $"Status changed to {newStatus}", Timestamp = DateTime.UtcNow },
transaction,
cancellationToken: cancellationToken));
await transaction.CommitAsync(cancellationToken);
}
catch
{
await transaction.RollbackAsync(cancellationToken);
throw;
}
}
}
Each tenant can have a table prefix and a schema. Read them from IStore.Configuration (TablePrefix includes the separator, Schema may be null) rather than from ShellSettings["TablePrefix"], which lacks the separator.
OrchardCore_YesSql is now OrchardCore:YesSql.OrchardCore_Data_Sqlite is now OrchardCore:Data:Sqlite.OrchardCore_Data_TableOptions is now OrchardCore:Data:TableOptions.OrchardCore_Documents is now OrchardCore:Documents.OrchardCore__YesSql__CommandsPageSize. The packages ship a ConfigurationSchema.json that gives appsettings.json IntelliSense and flags deprecated names.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, yessql, dapper, database-configuration, dotnet-cms
/orchardcore:orchardcore-datafrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard./orchardcore-admin-edit-viewsSkill for writing Orchard Core admin editor views with the ocat CSS classes and cards. Covers Edit views for content parts and fields, field editor variants, part, field and site settings editors, Fields.Edit views, admin pages rendering Model.Editor built with IDisplayManager, the ocat classes and their layout rules, label associations and group captions, part and field wrapper classes, validation, hints and the Hint_Admin shape, cards declared in placement and the Card and CardContainer shapes, split editor shapes, tabs and columns, the edit page action bar, the horizontal form layout, and the UI text casing standard. Use this skill when requests mention Orchard Core admin edit views, admin forms, grouping fields in cards, Edit.cshtml, Fields.Edit.cshtml, Settings.Edit.cshtml, ocat classes, label casing, or field hints. Strong matches include ocat-wrapper, ocat-card, Hint_Admin, PlacementLocationBuilder, IDisplayManager, ContentPartDisplayDriver, SiteDisplayDriver./orchardcore-admin-listsSkill for Orchard Core 4.0 admin index views (list pages) rendered with the AdminList shape. Covers the List and Grid layouts, AdminListContext of TModel, the admin-list and admin-list-column tag helpers, column width and alignment, row display drivers placing shapes for SummaryAdmin and SummaryAdminGrid, row templates and zones, AdminListActions Buttons and Menu layouts, AdminListToolbar, AdminListSearch, the list-management script for select-all and bulk actions, IAdminListColumnsProvider, AdminListOptions, user layout selection, per-list alternates, sortable lists, and upgrading overridden list views. Use this skill when requests mention Orchard Core admin index views, an admin index page, admin lists, converting a hand-written admin listing, grid layout, list columns, row actions menu, or adding a column to the content items list. Strong matches include OrchardCore.Admin.Abstractions, AdminListContext, AdminListColumn, IAdminListColumnsProvider, AdminListOptions, AdminListLayout, ContentsAdminList./orchardcore-admin-menuSkill for creating admin menus in Orchard Core. Covers admin menu content, the link, placeholder, content types, and lists admin node types, the AdminMenu recipe and deployment step, ManageAdminMenu, ViewAdminMenuAll and per-menu ViewAdminMenu permissions from AdminMenuPermissions, custom admin nodes with AdminNode, IAdminNodeNavigationBuilder and AddAdminNode, data localization of node text, rendering in the 4.0 TheAdmin menu, and upgrading from the removed legacy admin menu layout. Use this skill when requests mention Orchard Core Admin Menu, Create and Manage Admin Menus, Admin Menu Deployment Recipe Step, Built-In Admin Node Types, Custom Admin Node Class, LegacyAdminMenuNavigation, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminMenu, OrchardCore.AdminMenu.Abstractions, AdminMenuPermissions, LinkAdminNode, PlaceholderAdminNode, OrchardCore.Lists, OrchardCore.Navigation./orchardcore-admin-schemesSkill for the Orchard Core 4.0 TheAdmin redesign and its admin schemes. Covers scheme records with their four colors, typography, density, corners, horizontal form layout and content width, Design > Themes > Schemes, the default scheme, the per-user scheme picker and its cookie, the seven built-in schemes, the AdminSchemes recipe step and Admin Schemes deployment step, the schemes.css stylesheet, the --ta-* design tokens, ta-content-fluid, dark mode utilities and nested color modes, TheOldAdmin and how to switch to it, and the breaking changes for custom admin themes and Layout overrides. Use this skill when requests mention admin schemes, admin colors, rebranding TheAdmin, dark mode of the admin, the admin content width, the horizontal form layout, TheOldAdmin, or upgrading a custom admin theme to the new TheAdmin. Strong matches include AdminScheme, AdminSchemes, DefaultSchemeId, HorizontalFormLayout, ContentWidth, data-ta-scheme, --ta-primary, ta-content-fluid, TheOldAdmin, and OrchardCore.Themes.TheAdmin.Other plugins' skills for the same job