Database Expert

Installation
SKILL.md

Database Expert Skill (MySQL + MyBatis)

This skill focuses on Data Integrity, Query Performance, and MyBatis Configuration quality.

💾 Core Principles

  1. Schema First: Changes to Java Entities (AgCart) must match Database Schema (ag_cart) EXACTLY.
  2. MyBatis Consistency:
    • resultMap is preferred over resultType to handle snake_case to camelCase mapping safely.
    • Always explicitely list columns in <select>; avoid SELECT *.
  3. Performance:
    • Use PageHelper.startPage() BEFORE the query execution for pagination.
    • Ensure Foreign Keys (e.g., product_id) are indexed in MySQL.

🛠️ Common Workflows

1. Adding New Fields

Context: You added receiver_address to the table. Checklist:

  1. DB: Run ALTER TABLE script.
Related skills
Installs
First Seen