pocketbase-data-modeling

📁 anirudh-777/pocketbase-skills 📅 Today
2
总安装量
2
周安装量
#66259
全站排名
安装命令
npx skills add https://github.com/anirudh-777/pocketbase-skills --skill pocketbase-data-modeling

Agent 安装分布

gemini-cli 2
opencode 2
antigravity 2
github-copilot 2
codex 2
kimi-cli 2

Skill 文档

PocketBase Data Modeling

Overview

Use this skill for collection design, schema evolution, and data integrity in PocketBase.

When to Use

  • Creating new collections/fields
  • Adding relations and constraints
  • Designing indexes and query patterns
  • Planning breaking/non-breaking schema changes

Workflow

  1. Define access pattern first:
  • Key reads, writes, filters, and sorting requirements
  • Expected cardinality and data growth
  1. Model collections:
  • Use one collection per aggregate boundary
  • Use relation fields instead of denormalizing blindly
  • Keep metadata fields explicit (status, createdBy, updatedBy)
  1. Define validation and integrity:
  • Required fields and field-level constraints
  • Enum-like constraints via select fields
  • Unique indexes for identity fields
  1. Add migration plan:
  • Backward-compatible change first
  • Data backfill/transform step
  • Cleanup/deprecation step in later release
  1. Validate with representative queries:
  • Filtering, sorting, relation expansion, and pagination costs
  1. Handoff:
  • Rule implications -> pocketbase-auth-and-access
  • API usage optimization -> pocketbase-api-and-sdk
  • Migration safety and backups -> pocketbase-operations

References

Common Mistakes

  • Using one mega collection for unrelated entities
  • Shipping breaking schema changes without staged migrations
  • Adding relations without considering expansion/query performance