Database Expert

Optimize MySQL queries, MyBatis XML mappings, and schema design.

1|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/chrysaliscat/designgraduation --skill database-expert-chrysaliscat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Expert
Source: https://github.com/chrysaliscat/designgraduation/tree/main/.agent/skills/database-expert
Command: npx skills add https://github.com/chrysaliscat/designgraduation --skill database-expert-chrysaliscat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance to ensure data integrity, optimize query performance, and maintain consistency in database schemas and MyBatis configurations, particularly for MySQL.

Core Features & Use Cases

  • Schema Synchronization: Ensures Java entities and database tables are perfectly aligned.
  • MyBatis Best Practices: Promotes the use of resultMap for safe type conversion and explicit column selection in queries.
  • Performance Optimization: Guides on using pagination tools like PageHelper and indexing foreign keys.
  • Use Case: When adding a new field to a database table, this Skill helps you update the corresponding Java entity, MyBatis mapper XML, and ensure all necessary database changes are made correctly.

Quick Start

Use the Database Expert skill to add a new field to the 'users' table, ensuring it's reflected in the User entity and MyBatis mapper.

Frequently Asked Questions about Database Expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new field to a MySQL table and sync it with MyBatis and Java entities?

To add a new field to a MySQL table and sync it, you update the database schema, modify the corresponding Java entity, and adjust the MyBatis mapper XML. This ensures schema synchronization and maintains data integrity across the application layer.

What is the best way to optimize SQL query performance in MySQL?

The best way to optimize SQL query performance in MySQL involves indexing foreign keys and utilizing pagination tools like PageHelper. This approach enforces performance best practices and significantly reduces query execution time for large datasets.

Why should I use resultMap in MyBatis instead of direct column mapping?

You should use resultMap in MyBatis instead of direct mapping to ensure safe type conversion and explicit column selection. This MyBatis best practice prevents mapping errors and maintains configuration consistency when handling complex joins.

How do I handle complex relations with joins in MyBatis XML mapping?

Handling complex relations with joins in MyBatis XML mapping requires configuring resultMap for safe type conversion and explicit column selection. This approach debugs mapping issues effectively while enforcing schema-first principles for data integrity.

Does this database schema design approach work with existing MySQL workflows?

Yes, this database schema design approach works with existing MySQL workflows by enforcing schema-first principles. It supports adding new fields, handling complex relations with joins, and debugging mapping issues without disrupting your current database structure.

When do I need to update my MyBatis configuration for database schema changes?

You need to update your MyBatis configuration for database schema changes when adding new fields to ensure schema synchronization. This maintains MyBatis consistency and aligns Java entities with database tables to prevent runtime mapping errors.