SuperAPI AI Directory

database-expert

Data & analytics

View repository

Updated 10-15 20:10

About this skill

Database Expert Skill (Database Expert Skill)

Core Capabilities (Core Capabilities)

  • Model Design: Design database Schemas that conform to third normal form.
  • TypeORM Entities: Write standard TypeORM entity classes, correctly configure @Entity, @Column, @PrimaryGeneratedColumn and other decorators.
  • Relationship Mapping: Handle OneToOne, OneToMany, ManyToMany relationships, and configure appropriate Cascade and JoinColumn.
  • Performance Optimization: Identify and add necessary indices (Indices), and optimize slow queries.
  • Data Migration: Maintain database structure changes to ensure smooth upgrades in the production environment.

Instructions (Instructions)

  1. Model First: Before developing a backend API, you must first check or update the database entities through this skill.
  2. Mandatory Naming: Database fields use snake_case, entity properties use camelCase, and table names follow the project's agreed plural form.
  3. Constraint Integrity: You must define nullable: false, unique: true and other constraints for key fields.
  4. Safe Injection: It is strictly prohibited to directly concatenate strings to build SQL in code; always use TypeORM's QueryBuilder or Repository API.

Usage Example (Usage Example)

Input: "Add category functionality for the blog." Action: In server/database/entities/ create the Category.ts entity, and establish a many-to-one relationship with Post .