Claude Code Database Schema Skill for Nullable Queries
Confirm real field names, nullability and relationships before writing a query or regenerating types.
中文Install in Claude Code
Use a local project with a declared schema, migrations and fixtures. The example uses Prisma, but the same checks apply to other typed query layers.
- Get the complete `skills/database-schema` directory from the pinned revision.
- Copy it into the target project's `.claude/skills/` and confirm `.claude/skills/database-schema/SKILL.md`. Start Claude Code at the project root and describe a task matching the skill's purpose.
Example task
A library fixture has a nullable field `returnedAt`. Ask for a query that finds unreturned books and coverage using one returned and one unreturned fixture.What to check
The implementation uses the exact schema field and returns only the row where `returnedAt` is null. The test covers both fixtures.
Original SKILL.md on GitHub · Updated
Frequently asked question
What should I check when generated types disagree with the migration?
Confirm the applicable migration state and compare its field definition with the checked-in schema and generated types.