smithery/sids

sql-dao

SQL data access best practices for AIRBot reviewers

Installation

$ npx skills add smithery/sids --skill sql-dao

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/sids.

npx skills add smithery/sids

Browse all from smithery/sids

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,661 B
  • docs SUMMARY.md 66 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Mission

  • Guard database performance and correctness by enforcing disciplined DAO/DAL patterns.
  • Catch regressions that risk outages: unbounded queries, missing indexes, unsafe scripts, or misuse of replicas.

Query Execution Standards

  • Require explicit column selection (SELECT col1, col2) rather than SELECT *.
  • Prefer synchronous flows within jdbi.inTransaction {}; avoid mixing suspend calls inside transactions.
  • Enforce batching (@SqlBatch, @BatchChunkSize(2000)) for bulk inserts/updates and chunk large WHERE IN arguments (SQL Server limit ~2200 params).
  • Validate pagination on read-heavy endpoints; flag unbounded fetches or N+1 loops.
  • Ensure blocking annotations (@BlockingClass, @BlockingCall) exist for DAL/Repo classes and consumers.
  • Confirm master vs. replica usage: critical writes/reads hit master; replica lag can reach 30 minutes.

Indexing & Performance

  • Request evidence of supporting indexes for new predicates, sort columns, and pagination keys.
  • Encourage use of table aliases/prefixes in JOINs to maintain clarity.
  • For new queries, verify index coverage and that updated_at timestamps update alongside data mutations.
  • Demand UTC handling for timestamps and rely on the database (CURRENT_TIMESTAMP) to set them.

Schema & DDL Expectations

  • Ensure PRs document DDL changes and keep migrations incremental/backward compatible.
  • Require createdat/updatedat columns, primary keys, and consider unique constraints where appropriate.
  • Prefer NVARCHAR over VARCHAR; align column nullability with Kotlin model nullability.
  • Advocate for foreign keys to avoid orphaned rows and use online/resumable index operations.

Scripts & Data Ops

  • Scripts should live in dedicated packages, run transactional logic in managers/DAL, and treat CLI entrypoints as thin wrappers.
  • Verify bulk update scripts log progress, support mockRun, wrap per-row mutations in try/catch, and notify stakeholders before production runs.

Related Stores

  • Cosmos DB batches should rely on BulkExecutor; discourage ad-hoc parallel loops.
  • RedisCache2 usage must reuse clients, keep TTLs under 6 hours, and avoid local caches that cannot be invalidated.

Tooling Tips

  • Grep for SELECT *, @SqlBatch, inTransaction, or AsyncResponse inside DAO code to ensure patterns align.
  • Read migration files and DAL implementations to confirm pagination, batching, and index handling.
  • Glob Dao.kt, Repository.kt, *Script.kt to review related data access or scripting changes together.