Skip to content
Agentmart
Submit a tool

dapper-data-access

Design, implement, review, and test explicit SQL data access with Dapper and Microsoft.Data.SqlClient in .NET backends.

Skill by d-trattner

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/d-trattner-dapper-data-access

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Design, implement, review, and test explicit SQL data access with Dapper and Microsoft.Data.SqlClient in .NET backends. Use for queries, commands, mappings, transactions, connection ownership, cancellation, batching, and database boundaries. Prefer Dapper over introducing EF Core when explicit separation and readable SQL are desired.

Use cases: design, backend, testing, data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/dapper-data-access

What's inside

Skill name
dapper-data-access
Description
Design, implement, review, and test explicit SQL data access with Dapper and Microsoft.Data.SqlClient in .NET backends. Use for queries, commands, mappings, transactions, connection ownership, cancellation, batching, and database boundaries. Prefer Dapper over introducing EF Core when explicit separation and readable SQL are desired.
License
MIT
Metadata
pidex-module: pidex.dapper · dapper-snapshot: 2.1.79
Instructions
31 lines in SKILL.md · view on GitHub

Files (3)

  • SKILL.md
  • patterns.md · references/
  • sources.md · references/

SKILL.md (first lines)

# Dapper Data Access

Inspect provider, Dapper version, schema authority, connection/transaction ownership, SQL location, mapping conventions, retry policy, and integration tests first.

## Boundary

Keep Dapper, `DbConnection`, provider types, SQL, and row models in database/infrastructure layer. Application defines use-case-specific ports and outcomes; domain never depends on Dapper. Prefer explicit query/command objects or focused stores over generic repositories and hidden expression translators.

Dapper is default here because SQL and mapping stay visible. Do not add EF Core as parallel abstraction unless user explicitly chooses mixed persistence and ownership is clear.

## Query and command rules

- Parameterize every value. Never concatenate user input, identifiers, sort clauses, or predicates. Map dynamic identifiers/orderings through a closed allowlist.
- Name columns explicitly; avoid `SELECT *`. Keep projection and row mapping aligned.
- Use async APIs and pass `CancellationToken` through `CommandDefinition` where supported.
- Open connection near operation; dispose deterministically. Let pooling handle physical reuse. Never share mutable connection/transaction across concurrent requests.
- Pass transaction explicitly to every participating command. Commit only after all work succeeds; rollback/dispose on failure. Do not mix ambient and explicit ownership accidentally.
- Use one round trip or batching only when semantics remain clear. Avoid N+1 queries and unbounded `IN` lists; respect SQL Server parameter limits and payload size.
- Use `QuerySingle*`, `QueryFirst*`, or sequence methods according to cardinality invariant. Do not silently accept duplicate rows when uniqueness matters.
- Handle nullability, enums, value objects, decimals, dates, GUIDs, and multi-mapping deliberately. Database row types are not domain entities by default.
- Stored procedures and raw SQL remain versioned database contracts. Specify command type and parameters explicitly.

## Reliability and tests

Do not retry inside an active transaction blindly. Classify transient provider failures, idempotency, timeout, and commit ambiguity at application boundary. Log operation/template identity and duration, never secret parameter values.

Unit-test mapping-independent application logic. Use a disposable real SQL Server-compatible integration database for SQL syntax, collation, constraints, isolation, plans, and transaction behavior; mocks cannot prove these.

Review [patterns](references/patterns.md) and [sources](references/sources.md). Guidance only: no package installation, migration execution, or database connection.

From d-trattner/pidex, MIT.

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Sep 6, 2026 (1 month ago)
Last release
Oct 14, 2026 (14 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from d-trattner

Cite this page

dapper-data-access skill. Agent Mart. https://agentmart.dev/skills/d-trattner-dapper-data-access (last updated 2026-10-24)